<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - coverage_clean.info - 13/bits/stl_algo.h</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="title">LCOV - code coverage report</td></tr>
            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

            <tr>
              <td width="100%">
                <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="10%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">13/bits</a> - stl_algo.h<span style="font-size: 80%;"> (source / <a href="stl_algo.h.func-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="5%" class="headerCovTableHead">Coverage</td>
            <td width="5%" class="headerCovTableHead" title="Covered + Uncovered code">Total</td>
            <td width="5%" class="headerCovTableHead" title="Exercised code only">Hit</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">coverage_clean.info</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntryLo">0.0&nbsp;%</td>
            <td class="headerCovTableEntry">3</td>
            <td class="headerCovTableEntry">0</td>
          </tr>
          <tr>
            <td class="headerItem">Test Date:</td>
            <td class="headerValue">2025-11-25 04:45:29</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntryLo">0.0&nbsp;%</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">0</td>
          </tr>
                  <tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
                </table>
              </td>
            </tr>

            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
          </table>

          <table cellpadding=0 cellspacing=0 border=0>
            <tr>
              <td><br></td>
            </tr>
            <tr>
              <td>
<pre class="sourceHeading">            Line data    Source code</pre>
<pre class="source">
<span id="L1"><span class="lineNum">       1</span>              : // Algorithm implementation -*- C++ -*-</span>
<span id="L2"><span class="lineNum">       2</span>              : </span>
<span id="L3"><span class="lineNum">       3</span>              : // Copyright (C) 2001-2023 Free Software Foundation, Inc.</span>
<span id="L4"><span class="lineNum">       4</span>              : //</span>
<span id="L5"><span class="lineNum">       5</span>              : // This file is part of the GNU ISO C++ Library.  This library is free</span>
<span id="L6"><span class="lineNum">       6</span>              : // software; you can redistribute it and/or modify it under the</span>
<span id="L7"><span class="lineNum">       7</span>              : // terms of the GNU General Public License as published by the</span>
<span id="L8"><span class="lineNum">       8</span>              : // Free Software Foundation; either version 3, or (at your option)</span>
<span id="L9"><span class="lineNum">       9</span>              : // any later version.</span>
<span id="L10"><span class="lineNum">      10</span>              : </span>
<span id="L11"><span class="lineNum">      11</span>              : // This library is distributed in the hope that it will be useful,</span>
<span id="L12"><span class="lineNum">      12</span>              : // but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span id="L13"><span class="lineNum">      13</span>              : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span id="L14"><span class="lineNum">      14</span>              : // GNU General Public License for more details.</span>
<span id="L15"><span class="lineNum">      15</span>              : </span>
<span id="L16"><span class="lineNum">      16</span>              : // Under Section 7 of GPL version 3, you are granted additional</span>
<span id="L17"><span class="lineNum">      17</span>              : // permissions described in the GCC Runtime Library Exception, version</span>
<span id="L18"><span class="lineNum">      18</span>              : // 3.1, as published by the Free Software Foundation.</span>
<span id="L19"><span class="lineNum">      19</span>              : </span>
<span id="L20"><span class="lineNum">      20</span>              : // You should have received a copy of the GNU General Public License and</span>
<span id="L21"><span class="lineNum">      21</span>              : // a copy of the GCC Runtime Library Exception along with this program;</span>
<span id="L22"><span class="lineNum">      22</span>              : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see</span>
<span id="L23"><span class="lineNum">      23</span>              : // &lt;http://www.gnu.org/licenses/&gt;.</span>
<span id="L24"><span class="lineNum">      24</span>              : </span>
<span id="L25"><span class="lineNum">      25</span>              : /*</span>
<span id="L26"><span class="lineNum">      26</span>              :  *</span>
<span id="L27"><span class="lineNum">      27</span>              :  * Copyright (c) 1994</span>
<span id="L28"><span class="lineNum">      28</span>              :  * Hewlett-Packard Company</span>
<span id="L29"><span class="lineNum">      29</span>              :  *</span>
<span id="L30"><span class="lineNum">      30</span>              :  * Permission to use, copy, modify, distribute and sell this software</span>
<span id="L31"><span class="lineNum">      31</span>              :  * and its documentation for any purpose is hereby granted without fee,</span>
<span id="L32"><span class="lineNum">      32</span>              :  * provided that the above copyright notice appear in all copies and</span>
<span id="L33"><span class="lineNum">      33</span>              :  * that both that copyright notice and this permission notice appear</span>
<span id="L34"><span class="lineNum">      34</span>              :  * in supporting documentation.  Hewlett-Packard Company makes no</span>
<span id="L35"><span class="lineNum">      35</span>              :  * representations about the suitability of this software for any</span>
<span id="L36"><span class="lineNum">      36</span>              :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.</span>
<span id="L37"><span class="lineNum">      37</span>              :  *</span>
<span id="L38"><span class="lineNum">      38</span>              :  *</span>
<span id="L39"><span class="lineNum">      39</span>              :  * Copyright (c) 1996</span>
<span id="L40"><span class="lineNum">      40</span>              :  * Silicon Graphics Computer Systems, Inc.</span>
<span id="L41"><span class="lineNum">      41</span>              :  *</span>
<span id="L42"><span class="lineNum">      42</span>              :  * Permission to use, copy, modify, distribute and sell this software</span>
<span id="L43"><span class="lineNum">      43</span>              :  * and its documentation for any purpose is hereby granted without fee,</span>
<span id="L44"><span class="lineNum">      44</span>              :  * provided that the above copyright notice appear in all copies and</span>
<span id="L45"><span class="lineNum">      45</span>              :  * that both that copyright notice and this permission notice appear</span>
<span id="L46"><span class="lineNum">      46</span>              :  * in supporting documentation.  Silicon Graphics makes no</span>
<span id="L47"><span class="lineNum">      47</span>              :  * representations about the suitability of this software for any</span>
<span id="L48"><span class="lineNum">      48</span>              :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.</span>
<span id="L49"><span class="lineNum">      49</span>              :  */</span>
<span id="L50"><span class="lineNum">      50</span>              : </span>
<span id="L51"><span class="lineNum">      51</span>              : /** @file bits/stl_algo.h</span>
<span id="L52"><span class="lineNum">      52</span>              :  *  This is an internal header file, included by other library headers.</span>
<span id="L53"><span class="lineNum">      53</span>              :  *  Do not attempt to use it directly. @headername{algorithm}</span>
<span id="L54"><span class="lineNum">      54</span>              :  */</span>
<span id="L55"><span class="lineNum">      55</span>              : </span>
<span id="L56"><span class="lineNum">      56</span>              : #ifndef _STL_ALGO_H</span>
<span id="L57"><span class="lineNum">      57</span>              : #define _STL_ALGO_H 1</span>
<span id="L58"><span class="lineNum">      58</span>              : </span>
<span id="L59"><span class="lineNum">      59</span>              : #include &lt;bits/algorithmfwd.h&gt;</span>
<span id="L60"><span class="lineNum">      60</span>              : #include &lt;bits/stl_algobase.h&gt;</span>
<span id="L61"><span class="lineNum">      61</span>              : #include &lt;bits/stl_heap.h&gt;</span>
<span id="L62"><span class="lineNum">      62</span>              : #include &lt;bits/predefined_ops.h&gt;</span>
<span id="L63"><span class="lineNum">      63</span>              : </span>
<span id="L64"><span class="lineNum">      64</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L65"><span class="lineNum">      65</span>              : #include &lt;bits/uniform_int_dist.h&gt;</span>
<span id="L66"><span class="lineNum">      66</span>              : #endif</span>
<span id="L67"><span class="lineNum">      67</span>              : </span>
<span id="L68"><span class="lineNum">      68</span>              : #if _GLIBCXX_HOSTED</span>
<span id="L69"><span class="lineNum">      69</span>              : # include &lt;bits/stl_tempbuf.h&gt;  // for _Temporary_buffer</span>
<span id="L70"><span class="lineNum">      70</span>              : # if (__cplusplus &lt;= 201103L || _GLIBCXX_USE_DEPRECATED)</span>
<span id="L71"><span class="lineNum">      71</span>              : #  include &lt;cstdlib&gt;           // for rand</span>
<span id="L72"><span class="lineNum">      72</span>              : # endif</span>
<span id="L73"><span class="lineNum">      73</span>              : #endif</span>
<span id="L74"><span class="lineNum">      74</span>              : </span>
<span id="L75"><span class="lineNum">      75</span>              : // See concept_check.h for the __glibcxx_*_requires macros.</span>
<span id="L76"><span class="lineNum">      76</span>              : </span>
<span id="L77"><span class="lineNum">      77</span>              : namespace std _GLIBCXX_VISIBILITY(default)</span>
<span id="L78"><span class="lineNum">      78</span>              : {</span>
<span id="L79"><span class="lineNum">      79</span>              : _GLIBCXX_BEGIN_NAMESPACE_VERSION</span>
<span id="L80"><span class="lineNum">      80</span>              : </span>
<span id="L81"><span class="lineNum">      81</span>              :   /// Swaps the median value of *__a, *__b and *__c under __comp to *__result</span>
<span id="L82"><span class="lineNum">      82</span>              :   template&lt;typename _Iterator, typename _Compare&gt;</span>
<span id="L83"><span class="lineNum">      83</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L84"><span class="lineNum">      84</span>              :     void</span>
<span id="L85"><span class="lineNum">      85</span>              :     __move_median_to_first(_Iterator __result,_Iterator __a, _Iterator __b,</span>
<span id="L86"><span class="lineNum">      86</span>              :                            _Iterator __c, _Compare __comp)</span>
<span id="L87"><span class="lineNum">      87</span>              :     {</span>
<span id="L88"><span class="lineNum">      88</span>              :       if (__comp(__a, __b))</span>
<span id="L89"><span class="lineNum">      89</span>              :         {</span>
<span id="L90"><span class="lineNum">      90</span>              :           if (__comp(__b, __c))</span>
<span id="L91"><span class="lineNum">      91</span>              :             std::iter_swap(__result, __b);</span>
<span id="L92"><span class="lineNum">      92</span>              :           else if (__comp(__a, __c))</span>
<span id="L93"><span class="lineNum">      93</span>              :             std::iter_swap(__result, __c);</span>
<span id="L94"><span class="lineNum">      94</span>              :           else</span>
<span id="L95"><span class="lineNum">      95</span>              :             std::iter_swap(__result, __a);</span>
<span id="L96"><span class="lineNum">      96</span>              :         }</span>
<span id="L97"><span class="lineNum">      97</span>              :       else if (__comp(__a, __c))</span>
<span id="L98"><span class="lineNum">      98</span>              :         std::iter_swap(__result, __a);</span>
<span id="L99"><span class="lineNum">      99</span>              :       else if (__comp(__b, __c))</span>
<span id="L100"><span class="lineNum">     100</span>              :         std::iter_swap(__result, __c);</span>
<span id="L101"><span class="lineNum">     101</span>              :       else</span>
<span id="L102"><span class="lineNum">     102</span>              :         std::iter_swap(__result, __b);</span>
<span id="L103"><span class="lineNum">     103</span>              :     }</span>
<span id="L104"><span class="lineNum">     104</span>              : </span>
<span id="L105"><span class="lineNum">     105</span>              :   /// Provided for stable_partition to use.</span>
<span id="L106"><span class="lineNum">     106</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L107"><span class="lineNum">     107</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L108"><span class="lineNum">     108</span>              :     inline _InputIterator</span>
<span id="L109"><span class="lineNum">     109</span>              :     __find_if_not(_InputIterator __first, _InputIterator __last,</span>
<span id="L110"><span class="lineNum">     110</span>              :                   _Predicate __pred)</span>
<span id="L111"><span class="lineNum">     111</span>              :     {</span>
<span id="L112"><span class="lineNum">     112</span>              :       return std::__find_if(__first, __last,</span>
<span id="L113"><span class="lineNum">     113</span>              :                             __gnu_cxx::__ops::__negate(__pred),</span>
<span id="L114"><span class="lineNum">     114</span>              :                             std::__iterator_category(__first));</span>
<span id="L115"><span class="lineNum">     115</span>              :     }</span>
<span id="L116"><span class="lineNum">     116</span>              : </span>
<span id="L117"><span class="lineNum">     117</span>              :   /// Like find_if_not(), but uses and updates a count of the</span>
<span id="L118"><span class="lineNum">     118</span>              :   /// remaining range length instead of comparing against an end</span>
<span id="L119"><span class="lineNum">     119</span>              :   /// iterator.</span>
<span id="L120"><span class="lineNum">     120</span>              :   template&lt;typename _InputIterator, typename _Predicate, typename _Distance&gt;</span>
<span id="L121"><span class="lineNum">     121</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L122"><span class="lineNum">     122</span>              :     _InputIterator</span>
<span id="L123"><span class="lineNum">     123</span>              :     __find_if_not_n(_InputIterator __first, _Distance&amp; __len, _Predicate __pred)</span>
<span id="L124"><span class="lineNum">     124</span>              :     {</span>
<span id="L125"><span class="lineNum">     125</span>              :       for (; __len; --__len,  (void) ++__first)</span>
<span id="L126"><span class="lineNum">     126</span>              :         if (!__pred(__first))</span>
<span id="L127"><span class="lineNum">     127</span>              :           break;</span>
<span id="L128"><span class="lineNum">     128</span>              :       return __first;</span>
<span id="L129"><span class="lineNum">     129</span>              :     }</span>
<span id="L130"><span class="lineNum">     130</span>              : </span>
<span id="L131"><span class="lineNum">     131</span>              :   // set_difference</span>
<span id="L132"><span class="lineNum">     132</span>              :   // set_intersection</span>
<span id="L133"><span class="lineNum">     133</span>              :   // set_symmetric_difference</span>
<span id="L134"><span class="lineNum">     134</span>              :   // set_union</span>
<span id="L135"><span class="lineNum">     135</span>              :   // for_each</span>
<span id="L136"><span class="lineNum">     136</span>              :   // find</span>
<span id="L137"><span class="lineNum">     137</span>              :   // find_if</span>
<span id="L138"><span class="lineNum">     138</span>              :   // find_first_of</span>
<span id="L139"><span class="lineNum">     139</span>              :   // adjacent_find</span>
<span id="L140"><span class="lineNum">     140</span>              :   // count</span>
<span id="L141"><span class="lineNum">     141</span>              :   // count_if</span>
<span id="L142"><span class="lineNum">     142</span>              :   // search</span>
<span id="L143"><span class="lineNum">     143</span>              : </span>
<span id="L144"><span class="lineNum">     144</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L145"><span class="lineNum">     145</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L146"><span class="lineNum">     146</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L147"><span class="lineNum">     147</span>              :     _ForwardIterator1</span>
<span id="L148"><span class="lineNum">     148</span>              :     __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L149"><span class="lineNum">     149</span>              :              _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L150"><span class="lineNum">     150</span>              :              _BinaryPredicate  __predicate)</span>
<span id="L151"><span class="lineNum">     151</span>              :     {</span>
<span id="L152"><span class="lineNum">     152</span>              :       // Test for empty ranges</span>
<span id="L153"><span class="lineNum">     153</span>              :       if (__first1 == __last1 || __first2 == __last2)</span>
<span id="L154"><span class="lineNum">     154</span>              :         return __first1;</span>
<span id="L155"><span class="lineNum">     155</span>              : </span>
<span id="L156"><span class="lineNum">     156</span>              :       // Test for a pattern of length 1.</span>
<span id="L157"><span class="lineNum">     157</span>              :       _ForwardIterator2 __p1(__first2);</span>
<span id="L158"><span class="lineNum">     158</span>              :       if (++__p1 == __last2)</span>
<span id="L159"><span class="lineNum">     159</span>              :         return std::__find_if(__first1, __last1,</span>
<span id="L160"><span class="lineNum">     160</span>              :                 __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2));</span>
<span id="L161"><span class="lineNum">     161</span>              : </span>
<span id="L162"><span class="lineNum">     162</span>              :       // General case.</span>
<span id="L163"><span class="lineNum">     163</span>              :       _ForwardIterator1 __current = __first1;</span>
<span id="L164"><span class="lineNum">     164</span>              : </span>
<span id="L165"><span class="lineNum">     165</span>              :       for (;;)</span>
<span id="L166"><span class="lineNum">     166</span>              :         {</span>
<span id="L167"><span class="lineNum">     167</span>              :           __first1 =</span>
<span id="L168"><span class="lineNum">     168</span>              :             std::__find_if(__first1, __last1,</span>
<span id="L169"><span class="lineNum">     169</span>              :                 __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2));</span>
<span id="L170"><span class="lineNum">     170</span>              : </span>
<span id="L171"><span class="lineNum">     171</span>              :           if (__first1 == __last1)</span>
<span id="L172"><span class="lineNum">     172</span>              :             return __last1;</span>
<span id="L173"><span class="lineNum">     173</span>              : </span>
<span id="L174"><span class="lineNum">     174</span>              :           _ForwardIterator2 __p = __p1;</span>
<span id="L175"><span class="lineNum">     175</span>              :           __current = __first1;</span>
<span id="L176"><span class="lineNum">     176</span>              :           if (++__current == __last1)</span>
<span id="L177"><span class="lineNum">     177</span>              :             return __last1;</span>
<span id="L178"><span class="lineNum">     178</span>              : </span>
<span id="L179"><span class="lineNum">     179</span>              :           while (__predicate(__current, __p))</span>
<span id="L180"><span class="lineNum">     180</span>              :             {</span>
<span id="L181"><span class="lineNum">     181</span>              :               if (++__p == __last2)</span>
<span id="L182"><span class="lineNum">     182</span>              :                 return __first1;</span>
<span id="L183"><span class="lineNum">     183</span>              :               if (++__current == __last1)</span>
<span id="L184"><span class="lineNum">     184</span>              :                 return __last1;</span>
<span id="L185"><span class="lineNum">     185</span>              :             }</span>
<span id="L186"><span class="lineNum">     186</span>              :           ++__first1;</span>
<span id="L187"><span class="lineNum">     187</span>              :         }</span>
<span id="L188"><span class="lineNum">     188</span>              :       return __first1;</span>
<span id="L189"><span class="lineNum">     189</span>              :     }</span>
<span id="L190"><span class="lineNum">     190</span>              : </span>
<span id="L191"><span class="lineNum">     191</span>              :   // search_n</span>
<span id="L192"><span class="lineNum">     192</span>              : </span>
<span id="L193"><span class="lineNum">     193</span>              :   /**</span>
<span id="L194"><span class="lineNum">     194</span>              :    *  This is an helper function for search_n overloaded for forward iterators.</span>
<span id="L195"><span class="lineNum">     195</span>              :   */</span>
<span id="L196"><span class="lineNum">     196</span>              :   template&lt;typename _ForwardIterator, typename _Integer,</span>
<span id="L197"><span class="lineNum">     197</span>              :            typename _UnaryPredicate&gt;</span>
<span id="L198"><span class="lineNum">     198</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L199"><span class="lineNum">     199</span>              :     _ForwardIterator</span>
<span id="L200"><span class="lineNum">     200</span>              :     __search_n_aux(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L201"><span class="lineNum">     201</span>              :                    _Integer __count, _UnaryPredicate __unary_pred,</span>
<span id="L202"><span class="lineNum">     202</span>              :                    std::forward_iterator_tag)</span>
<span id="L203"><span class="lineNum">     203</span>              :     {</span>
<span id="L204"><span class="lineNum">     204</span>              :       __first = std::__find_if(__first, __last, __unary_pred);</span>
<span id="L205"><span class="lineNum">     205</span>              :       while (__first != __last)</span>
<span id="L206"><span class="lineNum">     206</span>              :         {</span>
<span id="L207"><span class="lineNum">     207</span>              :           typename iterator_traits&lt;_ForwardIterator&gt;::difference_type</span>
<span id="L208"><span class="lineNum">     208</span>              :             __n = __count;</span>
<span id="L209"><span class="lineNum">     209</span>              :           _ForwardIterator __i = __first;</span>
<span id="L210"><span class="lineNum">     210</span>              :           ++__i;</span>
<span id="L211"><span class="lineNum">     211</span>              :           while (__i != __last &amp;&amp; __n != 1 &amp;&amp; __unary_pred(__i))</span>
<span id="L212"><span class="lineNum">     212</span>              :             {</span>
<span id="L213"><span class="lineNum">     213</span>              :               ++__i;</span>
<span id="L214"><span class="lineNum">     214</span>              :               --__n;</span>
<span id="L215"><span class="lineNum">     215</span>              :             }</span>
<span id="L216"><span class="lineNum">     216</span>              :           if (__n == 1)</span>
<span id="L217"><span class="lineNum">     217</span>              :             return __first;</span>
<span id="L218"><span class="lineNum">     218</span>              :           if (__i == __last)</span>
<span id="L219"><span class="lineNum">     219</span>              :             return __last;</span>
<span id="L220"><span class="lineNum">     220</span>              :           __first = std::__find_if(++__i, __last, __unary_pred);</span>
<span id="L221"><span class="lineNum">     221</span>              :         }</span>
<span id="L222"><span class="lineNum">     222</span>              :       return __last;</span>
<span id="L223"><span class="lineNum">     223</span>              :     }</span>
<span id="L224"><span class="lineNum">     224</span>              : </span>
<span id="L225"><span class="lineNum">     225</span>              :   /**</span>
<span id="L226"><span class="lineNum">     226</span>              :    *  This is an helper function for search_n overloaded for random access</span>
<span id="L227"><span class="lineNum">     227</span>              :    *  iterators.</span>
<span id="L228"><span class="lineNum">     228</span>              :   */</span>
<span id="L229"><span class="lineNum">     229</span>              :   template&lt;typename _RandomAccessIter, typename _Integer,</span>
<span id="L230"><span class="lineNum">     230</span>              :            typename _UnaryPredicate&gt;</span>
<span id="L231"><span class="lineNum">     231</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L232"><span class="lineNum">     232</span>              :     _RandomAccessIter</span>
<span id="L233"><span class="lineNum">     233</span>              :     __search_n_aux(_RandomAccessIter __first, _RandomAccessIter __last,</span>
<span id="L234"><span class="lineNum">     234</span>              :                    _Integer __count, _UnaryPredicate __unary_pred,</span>
<span id="L235"><span class="lineNum">     235</span>              :                    std::random_access_iterator_tag)</span>
<span id="L236"><span class="lineNum">     236</span>              :     {</span>
<span id="L237"><span class="lineNum">     237</span>              :       typedef typename std::iterator_traits&lt;_RandomAccessIter&gt;::difference_type</span>
<span id="L238"><span class="lineNum">     238</span>              :         _DistanceType;</span>
<span id="L239"><span class="lineNum">     239</span>              : </span>
<span id="L240"><span class="lineNum">     240</span>              :       _DistanceType __tailSize = __last - __first;</span>
<span id="L241"><span class="lineNum">     241</span>              :       _DistanceType __remainder = __count;</span>
<span id="L242"><span class="lineNum">     242</span>              : </span>
<span id="L243"><span class="lineNum">     243</span>              :       while (__remainder &lt;= __tailSize) // the main loop...</span>
<span id="L244"><span class="lineNum">     244</span>              :         {</span>
<span id="L245"><span class="lineNum">     245</span>              :           __first += __remainder;</span>
<span id="L246"><span class="lineNum">     246</span>              :           __tailSize -= __remainder;</span>
<span id="L247"><span class="lineNum">     247</span>              :           // __first here is always pointing to one past the last element of</span>
<span id="L248"><span class="lineNum">     248</span>              :           // next possible match.</span>
<span id="L249"><span class="lineNum">     249</span>              :           _RandomAccessIter __backTrack = __first; </span>
<span id="L250"><span class="lineNum">     250</span>              :           while (__unary_pred(--__backTrack))</span>
<span id="L251"><span class="lineNum">     251</span>              :             {</span>
<span id="L252"><span class="lineNum">     252</span>              :               if (--__remainder == 0)</span>
<span id="L253"><span class="lineNum">     253</span>              :                 return (__first - __count); // Success</span>
<span id="L254"><span class="lineNum">     254</span>              :             }</span>
<span id="L255"><span class="lineNum">     255</span>              :           __remainder = __count + 1 - (__first - __backTrack);</span>
<span id="L256"><span class="lineNum">     256</span>              :         }</span>
<span id="L257"><span class="lineNum">     257</span>              :       return __last; // Failure</span>
<span id="L258"><span class="lineNum">     258</span>              :     }</span>
<span id="L259"><span class="lineNum">     259</span>              : </span>
<span id="L260"><span class="lineNum">     260</span>              :   template&lt;typename _ForwardIterator, typename _Integer,</span>
<span id="L261"><span class="lineNum">     261</span>              :            typename _UnaryPredicate&gt;</span>
<span id="L262"><span class="lineNum">     262</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L263"><span class="lineNum">     263</span>              :     _ForwardIterator</span>
<span id="L264"><span class="lineNum">     264</span>              :     __search_n(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L265"><span class="lineNum">     265</span>              :                _Integer __count,</span>
<span id="L266"><span class="lineNum">     266</span>              :                _UnaryPredicate __unary_pred)</span>
<span id="L267"><span class="lineNum">     267</span>              :     {</span>
<span id="L268"><span class="lineNum">     268</span>              :       if (__count &lt;= 0)</span>
<span id="L269"><span class="lineNum">     269</span>              :         return __first;</span>
<span id="L270"><span class="lineNum">     270</span>              : </span>
<span id="L271"><span class="lineNum">     271</span>              :       if (__count == 1)</span>
<span id="L272"><span class="lineNum">     272</span>              :         return std::__find_if(__first, __last, __unary_pred);</span>
<span id="L273"><span class="lineNum">     273</span>              : </span>
<span id="L274"><span class="lineNum">     274</span>              :       return std::__search_n_aux(__first, __last, __count, __unary_pred,</span>
<span id="L275"><span class="lineNum">     275</span>              :                                  std::__iterator_category(__first));</span>
<span id="L276"><span class="lineNum">     276</span>              :     }</span>
<span id="L277"><span class="lineNum">     277</span>              : </span>
<span id="L278"><span class="lineNum">     278</span>              :   // find_end for forward iterators.</span>
<span id="L279"><span class="lineNum">     279</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L280"><span class="lineNum">     280</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L281"><span class="lineNum">     281</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L282"><span class="lineNum">     282</span>              :     _ForwardIterator1</span>
<span id="L283"><span class="lineNum">     283</span>              :     __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L284"><span class="lineNum">     284</span>              :                _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L285"><span class="lineNum">     285</span>              :                forward_iterator_tag, forward_iterator_tag,</span>
<span id="L286"><span class="lineNum">     286</span>              :                _BinaryPredicate __comp)</span>
<span id="L287"><span class="lineNum">     287</span>              :     {</span>
<span id="L288"><span class="lineNum">     288</span>              :       if (__first2 == __last2)</span>
<span id="L289"><span class="lineNum">     289</span>              :         return __last1;</span>
<span id="L290"><span class="lineNum">     290</span>              : </span>
<span id="L291"><span class="lineNum">     291</span>              :       _ForwardIterator1 __result = __last1;</span>
<span id="L292"><span class="lineNum">     292</span>              :       while (1)</span>
<span id="L293"><span class="lineNum">     293</span>              :         {</span>
<span id="L294"><span class="lineNum">     294</span>              :           _ForwardIterator1 __new_result</span>
<span id="L295"><span class="lineNum">     295</span>              :             = std::__search(__first1, __last1, __first2, __last2, __comp);</span>
<span id="L296"><span class="lineNum">     296</span>              :           if (__new_result == __last1)</span>
<span id="L297"><span class="lineNum">     297</span>              :             return __result;</span>
<span id="L298"><span class="lineNum">     298</span>              :           else</span>
<span id="L299"><span class="lineNum">     299</span>              :             {</span>
<span id="L300"><span class="lineNum">     300</span>              :               __result = __new_result;</span>
<span id="L301"><span class="lineNum">     301</span>              :               __first1 = __new_result;</span>
<span id="L302"><span class="lineNum">     302</span>              :               ++__first1;</span>
<span id="L303"><span class="lineNum">     303</span>              :             }</span>
<span id="L304"><span class="lineNum">     304</span>              :         }</span>
<span id="L305"><span class="lineNum">     305</span>              :     }</span>
<span id="L306"><span class="lineNum">     306</span>              : </span>
<span id="L307"><span class="lineNum">     307</span>              :   // find_end for bidirectional iterators (much faster).</span>
<span id="L308"><span class="lineNum">     308</span>              :   template&lt;typename _BidirectionalIterator1, typename _BidirectionalIterator2,</span>
<span id="L309"><span class="lineNum">     309</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L310"><span class="lineNum">     310</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L311"><span class="lineNum">     311</span>              :     _BidirectionalIterator1</span>
<span id="L312"><span class="lineNum">     312</span>              :     __find_end(_BidirectionalIterator1 __first1,</span>
<span id="L313"><span class="lineNum">     313</span>              :                _BidirectionalIterator1 __last1,</span>
<span id="L314"><span class="lineNum">     314</span>              :                _BidirectionalIterator2 __first2,</span>
<span id="L315"><span class="lineNum">     315</span>              :                _BidirectionalIterator2 __last2,</span>
<span id="L316"><span class="lineNum">     316</span>              :                bidirectional_iterator_tag, bidirectional_iterator_tag,</span>
<span id="L317"><span class="lineNum">     317</span>              :                _BinaryPredicate __comp)</span>
<span id="L318"><span class="lineNum">     318</span>              :     {</span>
<span id="L319"><span class="lineNum">     319</span>              :       // concept requirements</span>
<span id="L320"><span class="lineNum">     320</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L321"><span class="lineNum">     321</span>              :                                   _BidirectionalIterator1&gt;)</span>
<span id="L322"><span class="lineNum">     322</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L323"><span class="lineNum">     323</span>              :                                   _BidirectionalIterator2&gt;)</span>
<span id="L324"><span class="lineNum">     324</span>              : </span>
<span id="L325"><span class="lineNum">     325</span>              :       typedef reverse_iterator&lt;_BidirectionalIterator1&gt; _RevIterator1;</span>
<span id="L326"><span class="lineNum">     326</span>              :       typedef reverse_iterator&lt;_BidirectionalIterator2&gt; _RevIterator2;</span>
<span id="L327"><span class="lineNum">     327</span>              : </span>
<span id="L328"><span class="lineNum">     328</span>              :       _RevIterator1 __rlast1(__first1);</span>
<span id="L329"><span class="lineNum">     329</span>              :       _RevIterator2 __rlast2(__first2);</span>
<span id="L330"><span class="lineNum">     330</span>              :       _RevIterator1 __rresult = std::__search(_RevIterator1(__last1), __rlast1,</span>
<span id="L331"><span class="lineNum">     331</span>              :                                               _RevIterator2(__last2), __rlast2,</span>
<span id="L332"><span class="lineNum">     332</span>              :                                               __comp);</span>
<span id="L333"><span class="lineNum">     333</span>              : </span>
<span id="L334"><span class="lineNum">     334</span>              :       if (__rresult == __rlast1)</span>
<span id="L335"><span class="lineNum">     335</span>              :         return __last1;</span>
<span id="L336"><span class="lineNum">     336</span>              :       else</span>
<span id="L337"><span class="lineNum">     337</span>              :         {</span>
<span id="L338"><span class="lineNum">     338</span>              :           _BidirectionalIterator1 __result = __rresult.base();</span>
<span id="L339"><span class="lineNum">     339</span>              :           std::advance(__result, -std::distance(__first2, __last2));</span>
<span id="L340"><span class="lineNum">     340</span>              :           return __result;</span>
<span id="L341"><span class="lineNum">     341</span>              :         }</span>
<span id="L342"><span class="lineNum">     342</span>              :     }</span>
<span id="L343"><span class="lineNum">     343</span>              : </span>
<span id="L344"><span class="lineNum">     344</span>              :   /**</span>
<span id="L345"><span class="lineNum">     345</span>              :    *  @brief  Find last matching subsequence in a sequence.</span>
<span id="L346"><span class="lineNum">     346</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L347"><span class="lineNum">     347</span>              :    *  @param  __first1  Start of range to search.</span>
<span id="L348"><span class="lineNum">     348</span>              :    *  @param  __last1   End of range to search.</span>
<span id="L349"><span class="lineNum">     349</span>              :    *  @param  __first2  Start of sequence to match.</span>
<span id="L350"><span class="lineNum">     350</span>              :    *  @param  __last2   End of sequence to match.</span>
<span id="L351"><span class="lineNum">     351</span>              :    *  @return   The last iterator @c i in the range</span>
<span id="L352"><span class="lineNum">     352</span>              :    *  @p [__first1,__last1-(__last2-__first2)) such that @c *(i+N) ==</span>
<span id="L353"><span class="lineNum">     353</span>              :    *  @p *(__first2+N) for each @c N in the range @p</span>
<span id="L354"><span class="lineNum">     354</span>              :    *  [0,__last2-__first2), or @p __last1 if no such iterator exists.</span>
<span id="L355"><span class="lineNum">     355</span>              :    *</span>
<span id="L356"><span class="lineNum">     356</span>              :    *  Searches the range @p [__first1,__last1) for a sub-sequence that</span>
<span id="L357"><span class="lineNum">     357</span>              :    *  compares equal value-by-value with the sequence given by @p</span>
<span id="L358"><span class="lineNum">     358</span>              :    *  [__first2,__last2) and returns an iterator to the __first</span>
<span id="L359"><span class="lineNum">     359</span>              :    *  element of the sub-sequence, or @p __last1 if the sub-sequence</span>
<span id="L360"><span class="lineNum">     360</span>              :    *  is not found.  The sub-sequence will be the last such</span>
<span id="L361"><span class="lineNum">     361</span>              :    *  subsequence contained in [__first1,__last1).</span>
<span id="L362"><span class="lineNum">     362</span>              :    *</span>
<span id="L363"><span class="lineNum">     363</span>              :    *  Because the sub-sequence must lie completely within the range @p</span>
<span id="L364"><span class="lineNum">     364</span>              :    *  [__first1,__last1) it must start at a position less than @p</span>
<span id="L365"><span class="lineNum">     365</span>              :    *  __last1-(__last2-__first2) where @p __last2-__first2 is the</span>
<span id="L366"><span class="lineNum">     366</span>              :    *  length of the sub-sequence.  This means that the returned</span>
<span id="L367"><span class="lineNum">     367</span>              :    *  iterator @c i will be in the range @p</span>
<span id="L368"><span class="lineNum">     368</span>              :    *  [__first1,__last1-(__last2-__first2))</span>
<span id="L369"><span class="lineNum">     369</span>              :   */</span>
<span id="L370"><span class="lineNum">     370</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2&gt;</span>
<span id="L371"><span class="lineNum">     371</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L372"><span class="lineNum">     372</span>              :     inline _ForwardIterator1</span>
<span id="L373"><span class="lineNum">     373</span>              :     find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L374"><span class="lineNum">     374</span>              :              _ForwardIterator2 __first2, _ForwardIterator2 __last2)</span>
<span id="L375"><span class="lineNum">     375</span>              :     {</span>
<span id="L376"><span class="lineNum">     376</span>              :       // concept requirements</span>
<span id="L377"><span class="lineNum">     377</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator1&gt;)</span>
<span id="L378"><span class="lineNum">     378</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator2&gt;)</span>
<span id="L379"><span class="lineNum">     379</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L380"><span class="lineNum">     380</span>              :             typename iterator_traits&lt;_ForwardIterator1&gt;::value_type,</span>
<span id="L381"><span class="lineNum">     381</span>              :             typename iterator_traits&lt;_ForwardIterator2&gt;::value_type&gt;)</span>
<span id="L382"><span class="lineNum">     382</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L383"><span class="lineNum">     383</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L384"><span class="lineNum">     384</span>              : </span>
<span id="L385"><span class="lineNum">     385</span>              :       return std::__find_end(__first1, __last1, __first2, __last2,</span>
<span id="L386"><span class="lineNum">     386</span>              :                              std::__iterator_category(__first1),</span>
<span id="L387"><span class="lineNum">     387</span>              :                              std::__iterator_category(__first2),</span>
<span id="L388"><span class="lineNum">     388</span>              :                              __gnu_cxx::__ops::__iter_equal_to_iter());</span>
<span id="L389"><span class="lineNum">     389</span>              :     }</span>
<span id="L390"><span class="lineNum">     390</span>              : </span>
<span id="L391"><span class="lineNum">     391</span>              :   /**</span>
<span id="L392"><span class="lineNum">     392</span>              :    *  @brief  Find last matching subsequence in a sequence using a predicate.</span>
<span id="L393"><span class="lineNum">     393</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L394"><span class="lineNum">     394</span>              :    *  @param  __first1  Start of range to search.</span>
<span id="L395"><span class="lineNum">     395</span>              :    *  @param  __last1   End of range to search.</span>
<span id="L396"><span class="lineNum">     396</span>              :    *  @param  __first2  Start of sequence to match.</span>
<span id="L397"><span class="lineNum">     397</span>              :    *  @param  __last2   End of sequence to match.</span>
<span id="L398"><span class="lineNum">     398</span>              :    *  @param  __comp    The predicate to use.</span>
<span id="L399"><span class="lineNum">     399</span>              :    *  @return The last iterator @c i in the range @p</span>
<span id="L400"><span class="lineNum">     400</span>              :    *  [__first1,__last1-(__last2-__first2)) such that @c</span>
<span id="L401"><span class="lineNum">     401</span>              :    *  predicate(*(i+N), @p (__first2+N)) is true for each @c N in the</span>
<span id="L402"><span class="lineNum">     402</span>              :    *  range @p [0,__last2-__first2), or @p __last1 if no such iterator</span>
<span id="L403"><span class="lineNum">     403</span>              :    *  exists.</span>
<span id="L404"><span class="lineNum">     404</span>              :    *</span>
<span id="L405"><span class="lineNum">     405</span>              :    *  Searches the range @p [__first1,__last1) for a sub-sequence that</span>
<span id="L406"><span class="lineNum">     406</span>              :    *  compares equal value-by-value with the sequence given by @p</span>
<span id="L407"><span class="lineNum">     407</span>              :    *  [__first2,__last2) using comp as a predicate and returns an</span>
<span id="L408"><span class="lineNum">     408</span>              :    *  iterator to the first element of the sub-sequence, or @p __last1</span>
<span id="L409"><span class="lineNum">     409</span>              :    *  if the sub-sequence is not found.  The sub-sequence will be the</span>
<span id="L410"><span class="lineNum">     410</span>              :    *  last such subsequence contained in [__first,__last1).</span>
<span id="L411"><span class="lineNum">     411</span>              :    *</span>
<span id="L412"><span class="lineNum">     412</span>              :    *  Because the sub-sequence must lie completely within the range @p</span>
<span id="L413"><span class="lineNum">     413</span>              :    *  [__first1,__last1) it must start at a position less than @p</span>
<span id="L414"><span class="lineNum">     414</span>              :    *  __last1-(__last2-__first2) where @p __last2-__first2 is the</span>
<span id="L415"><span class="lineNum">     415</span>              :    *  length of the sub-sequence.  This means that the returned</span>
<span id="L416"><span class="lineNum">     416</span>              :    *  iterator @c i will be in the range @p</span>
<span id="L417"><span class="lineNum">     417</span>              :    *  [__first1,__last1-(__last2-__first2))</span>
<span id="L418"><span class="lineNum">     418</span>              :   */</span>
<span id="L419"><span class="lineNum">     419</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L420"><span class="lineNum">     420</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L421"><span class="lineNum">     421</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L422"><span class="lineNum">     422</span>              :     inline _ForwardIterator1</span>
<span id="L423"><span class="lineNum">     423</span>              :     find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L424"><span class="lineNum">     424</span>              :              _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L425"><span class="lineNum">     425</span>              :              _BinaryPredicate __comp)</span>
<span id="L426"><span class="lineNum">     426</span>              :     {</span>
<span id="L427"><span class="lineNum">     427</span>              :       // concept requirements</span>
<span id="L428"><span class="lineNum">     428</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator1&gt;)</span>
<span id="L429"><span class="lineNum">     429</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator2&gt;)</span>
<span id="L430"><span class="lineNum">     430</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L431"><span class="lineNum">     431</span>              :             typename iterator_traits&lt;_ForwardIterator1&gt;::value_type,</span>
<span id="L432"><span class="lineNum">     432</span>              :             typename iterator_traits&lt;_ForwardIterator2&gt;::value_type&gt;)</span>
<span id="L433"><span class="lineNum">     433</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L434"><span class="lineNum">     434</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L435"><span class="lineNum">     435</span>              : </span>
<span id="L436"><span class="lineNum">     436</span>              :       return std::__find_end(__first1, __last1, __first2, __last2,</span>
<span id="L437"><span class="lineNum">     437</span>              :                              std::__iterator_category(__first1),</span>
<span id="L438"><span class="lineNum">     438</span>              :                              std::__iterator_category(__first2),</span>
<span id="L439"><span class="lineNum">     439</span>              :                              __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L440"><span class="lineNum">     440</span>              :     }</span>
<span id="L441"><span class="lineNum">     441</span>              : </span>
<span id="L442"><span class="lineNum">     442</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L443"><span class="lineNum">     443</span>              :   /**</span>
<span id="L444"><span class="lineNum">     444</span>              :    *  @brief  Checks that a predicate is true for all the elements</span>
<span id="L445"><span class="lineNum">     445</span>              :    *          of a sequence.</span>
<span id="L446"><span class="lineNum">     446</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L447"><span class="lineNum">     447</span>              :    *  @param  __first   An input iterator.</span>
<span id="L448"><span class="lineNum">     448</span>              :    *  @param  __last    An input iterator.</span>
<span id="L449"><span class="lineNum">     449</span>              :    *  @param  __pred    A predicate.</span>
<span id="L450"><span class="lineNum">     450</span>              :    *  @return  True if the check is true, false otherwise.</span>
<span id="L451"><span class="lineNum">     451</span>              :    *</span>
<span id="L452"><span class="lineNum">     452</span>              :    *  Returns true if @p __pred is true for each element in the range</span>
<span id="L453"><span class="lineNum">     453</span>              :    *  @p [__first,__last), and false otherwise.</span>
<span id="L454"><span class="lineNum">     454</span>              :   */</span>
<span id="L455"><span class="lineNum">     455</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L456"><span class="lineNum">     456</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L457"><span class="lineNum">     457</span>              :     inline bool</span>
<span id="L458"><span class="lineNum">     458</span>              :     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)</span>
<span id="L459"><span class="lineNum">     459</span>              :     { return __last == std::find_if_not(__first, __last, __pred); }</span>
<span id="L460"><span class="lineNum">     460</span>              : </span>
<span id="L461"><span class="lineNum">     461</span>              :   /**</span>
<span id="L462"><span class="lineNum">     462</span>              :    *  @brief  Checks that a predicate is false for all the elements</span>
<span id="L463"><span class="lineNum">     463</span>              :    *          of a sequence.</span>
<span id="L464"><span class="lineNum">     464</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L465"><span class="lineNum">     465</span>              :    *  @param  __first   An input iterator.</span>
<span id="L466"><span class="lineNum">     466</span>              :    *  @param  __last    An input iterator.</span>
<span id="L467"><span class="lineNum">     467</span>              :    *  @param  __pred    A predicate.</span>
<span id="L468"><span class="lineNum">     468</span>              :    *  @return  True if the check is true, false otherwise.</span>
<span id="L469"><span class="lineNum">     469</span>              :    *</span>
<span id="L470"><span class="lineNum">     470</span>              :    *  Returns true if @p __pred is false for each element in the range</span>
<span id="L471"><span class="lineNum">     471</span>              :    *  @p [__first,__last), and false otherwise.</span>
<span id="L472"><span class="lineNum">     472</span>              :   */</span>
<span id="L473"><span class="lineNum">     473</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L474"><span class="lineNum">     474</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L475"><span class="lineNum">     475</span>              :     inline bool</span>
<span id="L476"><span class="lineNum">     476</span>              :     none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)</span>
<span id="L477"><span class="lineNum">     477</span>              :     { return __last == _GLIBCXX_STD_A::find_if(__first, __last, __pred); }</span>
<span id="L478"><span class="lineNum">     478</span>              : </span>
<span id="L479"><span class="lineNum">     479</span>              :   /**</span>
<span id="L480"><span class="lineNum">     480</span>              :    *  @brief  Checks that a predicate is true for at least one element</span>
<span id="L481"><span class="lineNum">     481</span>              :    *          of a sequence.</span>
<span id="L482"><span class="lineNum">     482</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L483"><span class="lineNum">     483</span>              :    *  @param  __first   An input iterator.</span>
<span id="L484"><span class="lineNum">     484</span>              :    *  @param  __last    An input iterator.</span>
<span id="L485"><span class="lineNum">     485</span>              :    *  @param  __pred    A predicate.</span>
<span id="L486"><span class="lineNum">     486</span>              :    *  @return  True if the check is true, false otherwise.</span>
<span id="L487"><span class="lineNum">     487</span>              :    *</span>
<span id="L488"><span class="lineNum">     488</span>              :    *  Returns true if an element exists in the range @p</span>
<span id="L489"><span class="lineNum">     489</span>              :    *  [__first,__last) such that @p __pred is true, and false</span>
<span id="L490"><span class="lineNum">     490</span>              :    *  otherwise.</span>
<span id="L491"><span class="lineNum">     491</span>              :   */</span>
<span id="L492"><span class="lineNum">     492</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L493"><span class="lineNum">     493</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L494"><span class="lineNum">     494</span>              :     inline bool</span>
<span id="L495"><span class="lineNum">     495</span>              :     any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)</span>
<span id="L496"><span class="lineNum">     496</span>              :     { return !std::none_of(__first, __last, __pred); }</span>
<span id="L497"><span class="lineNum">     497</span>              : </span>
<span id="L498"><span class="lineNum">     498</span>              :   /**</span>
<span id="L499"><span class="lineNum">     499</span>              :    *  @brief  Find the first element in a sequence for which a</span>
<span id="L500"><span class="lineNum">     500</span>              :    *          predicate is false.</span>
<span id="L501"><span class="lineNum">     501</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L502"><span class="lineNum">     502</span>              :    *  @param  __first  An input iterator.</span>
<span id="L503"><span class="lineNum">     503</span>              :    *  @param  __last   An input iterator.</span>
<span id="L504"><span class="lineNum">     504</span>              :    *  @param  __pred   A predicate.</span>
<span id="L505"><span class="lineNum">     505</span>              :    *  @return   The first iterator @c i in the range @p [__first,__last)</span>
<span id="L506"><span class="lineNum">     506</span>              :    *  such that @p __pred(*i) is false, or @p __last if no such iterator exists.</span>
<span id="L507"><span class="lineNum">     507</span>              :   */</span>
<span id="L508"><span class="lineNum">     508</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L509"><span class="lineNum">     509</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L510"><span class="lineNum">     510</span>              :     inline _InputIterator</span>
<span id="L511"><span class="lineNum">     511</span>              :     find_if_not(_InputIterator __first, _InputIterator __last,</span>
<span id="L512"><span class="lineNum">     512</span>              :                 _Predicate __pred)</span>
<span id="L513"><span class="lineNum">     513</span>              :     {</span>
<span id="L514"><span class="lineNum">     514</span>              :       // concept requirements</span>
<span id="L515"><span class="lineNum">     515</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L516"><span class="lineNum">     516</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L517"><span class="lineNum">     517</span>              :               typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L518"><span class="lineNum">     518</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L519"><span class="lineNum">     519</span>              :       return std::__find_if_not(__first, __last,</span>
<span id="L520"><span class="lineNum">     520</span>              :                                 __gnu_cxx::__ops::__pred_iter(__pred));</span>
<span id="L521"><span class="lineNum">     521</span>              :     }</span>
<span id="L522"><span class="lineNum">     522</span>              : </span>
<span id="L523"><span class="lineNum">     523</span>              :   /**</span>
<span id="L524"><span class="lineNum">     524</span>              :    *  @brief  Checks whether the sequence is partitioned.</span>
<span id="L525"><span class="lineNum">     525</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L526"><span class="lineNum">     526</span>              :    *  @param  __first  An input iterator.</span>
<span id="L527"><span class="lineNum">     527</span>              :    *  @param  __last   An input iterator.</span>
<span id="L528"><span class="lineNum">     528</span>              :    *  @param  __pred   A predicate.</span>
<span id="L529"><span class="lineNum">     529</span>              :    *  @return  True if the range @p [__first,__last) is partioned by @p __pred,</span>
<span id="L530"><span class="lineNum">     530</span>              :    *  i.e. if all elements that satisfy @p __pred appear before those that</span>
<span id="L531"><span class="lineNum">     531</span>              :    *  do not.</span>
<span id="L532"><span class="lineNum">     532</span>              :   */</span>
<span id="L533"><span class="lineNum">     533</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L534"><span class="lineNum">     534</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L535"><span class="lineNum">     535</span>              :     inline bool</span>
<span id="L536"><span class="lineNum">     536</span>              :     is_partitioned(_InputIterator __first, _InputIterator __last,</span>
<span id="L537"><span class="lineNum">     537</span>              :                    _Predicate __pred)</span>
<span id="L538"><span class="lineNum">     538</span>              :     {</span>
<span id="L539"><span class="lineNum">     539</span>              :       __first = std::find_if_not(__first, __last, __pred);</span>
<span id="L540"><span class="lineNum">     540</span>              :       if (__first == __last)</span>
<span id="L541"><span class="lineNum">     541</span>              :         return true;</span>
<span id="L542"><span class="lineNum">     542</span>              :       ++__first;</span>
<span id="L543"><span class="lineNum">     543</span>              :       return std::none_of(__first, __last, __pred);</span>
<span id="L544"><span class="lineNum">     544</span>              :     }</span>
<span id="L545"><span class="lineNum">     545</span>              : </span>
<span id="L546"><span class="lineNum">     546</span>              :   /**</span>
<span id="L547"><span class="lineNum">     547</span>              :    *  @brief  Find the partition point of a partitioned range.</span>
<span id="L548"><span class="lineNum">     548</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L549"><span class="lineNum">     549</span>              :    *  @param  __first   An iterator.</span>
<span id="L550"><span class="lineNum">     550</span>              :    *  @param  __last    Another iterator.</span>
<span id="L551"><span class="lineNum">     551</span>              :    *  @param  __pred    A predicate.</span>
<span id="L552"><span class="lineNum">     552</span>              :    *  @return  An iterator @p mid such that @p all_of(__first, mid, __pred)</span>
<span id="L553"><span class="lineNum">     553</span>              :    *           and @p none_of(mid, __last, __pred) are both true.</span>
<span id="L554"><span class="lineNum">     554</span>              :   */</span>
<span id="L555"><span class="lineNum">     555</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L556"><span class="lineNum">     556</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L557"><span class="lineNum">     557</span>              :     _ForwardIterator</span>
<span id="L558"><span class="lineNum">     558</span>              :     partition_point(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L559"><span class="lineNum">     559</span>              :                     _Predicate __pred)</span>
<span id="L560"><span class="lineNum">     560</span>              :     {</span>
<span id="L561"><span class="lineNum">     561</span>              :       // concept requirements</span>
<span id="L562"><span class="lineNum">     562</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L563"><span class="lineNum">     563</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L564"><span class="lineNum">     564</span>              :               typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L565"><span class="lineNum">     565</span>              : </span>
<span id="L566"><span class="lineNum">     566</span>              :       // A specific debug-mode test will be necessary...</span>
<span id="L567"><span class="lineNum">     567</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L568"><span class="lineNum">     568</span>              : </span>
<span id="L569"><span class="lineNum">     569</span>              :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::difference_type</span>
<span id="L570"><span class="lineNum">     570</span>              :         _DistanceType;</span>
<span id="L571"><span class="lineNum">     571</span>              : </span>
<span id="L572"><span class="lineNum">     572</span>              :       _DistanceType __len = std::distance(__first, __last);</span>
<span id="L573"><span class="lineNum">     573</span>              : </span>
<span id="L574"><span class="lineNum">     574</span>              :       while (__len &gt; 0)</span>
<span id="L575"><span class="lineNum">     575</span>              :         {</span>
<span id="L576"><span class="lineNum">     576</span>              :           _DistanceType __half = __len &gt;&gt; 1;</span>
<span id="L577"><span class="lineNum">     577</span>              :           _ForwardIterator __middle = __first;</span>
<span id="L578"><span class="lineNum">     578</span>              :           std::advance(__middle, __half);</span>
<span id="L579"><span class="lineNum">     579</span>              :           if (__pred(*__middle))</span>
<span id="L580"><span class="lineNum">     580</span>              :             {</span>
<span id="L581"><span class="lineNum">     581</span>              :               __first = __middle;</span>
<span id="L582"><span class="lineNum">     582</span>              :               ++__first;</span>
<span id="L583"><span class="lineNum">     583</span>              :               __len = __len - __half - 1;</span>
<span id="L584"><span class="lineNum">     584</span>              :             }</span>
<span id="L585"><span class="lineNum">     585</span>              :           else</span>
<span id="L586"><span class="lineNum">     586</span>              :             __len = __half;</span>
<span id="L587"><span class="lineNum">     587</span>              :         }</span>
<span id="L588"><span class="lineNum">     588</span>              :       return __first;</span>
<span id="L589"><span class="lineNum">     589</span>              :     }</span>
<span id="L590"><span class="lineNum">     590</span>              : #endif</span>
<span id="L591"><span class="lineNum">     591</span>              : </span>
<span id="L592"><span class="lineNum">     592</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L593"><span class="lineNum">     593</span>              :            typename _Predicate&gt;</span>
<span id="L594"><span class="lineNum">     594</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L595"><span class="lineNum">     595</span>              :     _OutputIterator</span>
<span id="L596"><span class="lineNum">     596</span>              :     __remove_copy_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L597"><span class="lineNum">     597</span>              :                      _OutputIterator __result, _Predicate __pred)</span>
<span id="L598"><span class="lineNum">     598</span>              :     {</span>
<span id="L599"><span class="lineNum">     599</span>              :       for (; __first != __last; ++__first)</span>
<span id="L600"><span class="lineNum">     600</span>              :         if (!__pred(__first))</span>
<span id="L601"><span class="lineNum">     601</span>              :           {</span>
<span id="L602"><span class="lineNum">     602</span>              :             *__result = *__first;</span>
<span id="L603"><span class="lineNum">     603</span>              :             ++__result;</span>
<span id="L604"><span class="lineNum">     604</span>              :           }</span>
<span id="L605"><span class="lineNum">     605</span>              :       return __result;</span>
<span id="L606"><span class="lineNum">     606</span>              :     }</span>
<span id="L607"><span class="lineNum">     607</span>              : </span>
<span id="L608"><span class="lineNum">     608</span>              :   /**</span>
<span id="L609"><span class="lineNum">     609</span>              :    *  @brief Copy a sequence, removing elements of a given value.</span>
<span id="L610"><span class="lineNum">     610</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L611"><span class="lineNum">     611</span>              :    *  @param  __first   An input iterator.</span>
<span id="L612"><span class="lineNum">     612</span>              :    *  @param  __last    An input iterator.</span>
<span id="L613"><span class="lineNum">     613</span>              :    *  @param  __result  An output iterator.</span>
<span id="L614"><span class="lineNum">     614</span>              :    *  @param  __value   The value to be removed.</span>
<span id="L615"><span class="lineNum">     615</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L616"><span class="lineNum">     616</span>              :    *</span>
<span id="L617"><span class="lineNum">     617</span>              :    *  Copies each element in the range @p [__first,__last) not equal</span>
<span id="L618"><span class="lineNum">     618</span>              :    *  to @p __value to the range beginning at @p __result.</span>
<span id="L619"><span class="lineNum">     619</span>              :    *  remove_copy() is stable, so the relative order of elements that</span>
<span id="L620"><span class="lineNum">     620</span>              :    *  are copied is unchanged.</span>
<span id="L621"><span class="lineNum">     621</span>              :   */</span>
<span id="L622"><span class="lineNum">     622</span>              :   template&lt;typename _InputIterator, typename _OutputIterator, typename _Tp&gt;</span>
<span id="L623"><span class="lineNum">     623</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L624"><span class="lineNum">     624</span>              :     inline _OutputIterator</span>
<span id="L625"><span class="lineNum">     625</span>              :     remove_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L626"><span class="lineNum">     626</span>              :                 _OutputIterator __result, const _Tp&amp; __value)</span>
<span id="L627"><span class="lineNum">     627</span>              :     {</span>
<span id="L628"><span class="lineNum">     628</span>              :       // concept requirements</span>
<span id="L629"><span class="lineNum">     629</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L630"><span class="lineNum">     630</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L631"><span class="lineNum">     631</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L632"><span class="lineNum">     632</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L633"><span class="lineNum">     633</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L634"><span class="lineNum">     634</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L635"><span class="lineNum">     635</span>              : </span>
<span id="L636"><span class="lineNum">     636</span>              :       return std::__remove_copy_if(__first, __last, __result,</span>
<span id="L637"><span class="lineNum">     637</span>              :         __gnu_cxx::__ops::__iter_equals_val(__value));</span>
<span id="L638"><span class="lineNum">     638</span>              :     }</span>
<span id="L639"><span class="lineNum">     639</span>              : </span>
<span id="L640"><span class="lineNum">     640</span>              :   /**</span>
<span id="L641"><span class="lineNum">     641</span>              :    *  @brief Copy a sequence, removing elements for which a predicate is true.</span>
<span id="L642"><span class="lineNum">     642</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L643"><span class="lineNum">     643</span>              :    *  @param  __first   An input iterator.</span>
<span id="L644"><span class="lineNum">     644</span>              :    *  @param  __last    An input iterator.</span>
<span id="L645"><span class="lineNum">     645</span>              :    *  @param  __result  An output iterator.</span>
<span id="L646"><span class="lineNum">     646</span>              :    *  @param  __pred    A predicate.</span>
<span id="L647"><span class="lineNum">     647</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L648"><span class="lineNum">     648</span>              :    *</span>
<span id="L649"><span class="lineNum">     649</span>              :    *  Copies each element in the range @p [__first,__last) for which</span>
<span id="L650"><span class="lineNum">     650</span>              :    *  @p __pred returns false to the range beginning at @p __result.</span>
<span id="L651"><span class="lineNum">     651</span>              :    *</span>
<span id="L652"><span class="lineNum">     652</span>              :    *  remove_copy_if() is stable, so the relative order of elements that are</span>
<span id="L653"><span class="lineNum">     653</span>              :    *  copied is unchanged.</span>
<span id="L654"><span class="lineNum">     654</span>              :   */</span>
<span id="L655"><span class="lineNum">     655</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L656"><span class="lineNum">     656</span>              :            typename _Predicate&gt;</span>
<span id="L657"><span class="lineNum">     657</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L658"><span class="lineNum">     658</span>              :     inline _OutputIterator</span>
<span id="L659"><span class="lineNum">     659</span>              :     remove_copy_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L660"><span class="lineNum">     660</span>              :                    _OutputIterator __result, _Predicate __pred)</span>
<span id="L661"><span class="lineNum">     661</span>              :     {</span>
<span id="L662"><span class="lineNum">     662</span>              :       // concept requirements</span>
<span id="L663"><span class="lineNum">     663</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L664"><span class="lineNum">     664</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L665"><span class="lineNum">     665</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L666"><span class="lineNum">     666</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L667"><span class="lineNum">     667</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L668"><span class="lineNum">     668</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L669"><span class="lineNum">     669</span>              : </span>
<span id="L670"><span class="lineNum">     670</span>              :       return std::__remove_copy_if(__first, __last, __result,</span>
<span id="L671"><span class="lineNum">     671</span>              :                                    __gnu_cxx::__ops::__pred_iter(__pred));</span>
<span id="L672"><span class="lineNum">     672</span>              :     }</span>
<span id="L673"><span class="lineNum">     673</span>              : </span>
<span id="L674"><span class="lineNum">     674</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L675"><span class="lineNum">     675</span>              :   /**</span>
<span id="L676"><span class="lineNum">     676</span>              :    *  @brief Copy the elements of a sequence for which a predicate is true.</span>
<span id="L677"><span class="lineNum">     677</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L678"><span class="lineNum">     678</span>              :    *  @param  __first   An input iterator.</span>
<span id="L679"><span class="lineNum">     679</span>              :    *  @param  __last    An input iterator.</span>
<span id="L680"><span class="lineNum">     680</span>              :    *  @param  __result  An output iterator.</span>
<span id="L681"><span class="lineNum">     681</span>              :    *  @param  __pred    A predicate.</span>
<span id="L682"><span class="lineNum">     682</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L683"><span class="lineNum">     683</span>              :    *</span>
<span id="L684"><span class="lineNum">     684</span>              :    *  Copies each element in the range @p [__first,__last) for which</span>
<span id="L685"><span class="lineNum">     685</span>              :    *  @p __pred returns true to the range beginning at @p __result.</span>
<span id="L686"><span class="lineNum">     686</span>              :    *</span>
<span id="L687"><span class="lineNum">     687</span>              :    *  copy_if() is stable, so the relative order of elements that are</span>
<span id="L688"><span class="lineNum">     688</span>              :    *  copied is unchanged.</span>
<span id="L689"><span class="lineNum">     689</span>              :   */</span>
<span id="L690"><span class="lineNum">     690</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L691"><span class="lineNum">     691</span>              :            typename _Predicate&gt;</span>
<span id="L692"><span class="lineNum">     692</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L693"><span class="lineNum">     693</span>              :     _OutputIterator</span>
<span id="L694"><span class="lineNum">     694</span>              :     copy_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L695"><span class="lineNum">     695</span>              :             _OutputIterator __result, _Predicate __pred)</span>
<span id="L696"><span class="lineNum">     696</span>              :     {</span>
<span id="L697"><span class="lineNum">     697</span>              :       // concept requirements</span>
<span id="L698"><span class="lineNum">     698</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L699"><span class="lineNum">     699</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L700"><span class="lineNum">     700</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L701"><span class="lineNum">     701</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L702"><span class="lineNum">     702</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L703"><span class="lineNum">     703</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L704"><span class="lineNum">     704</span>              : </span>
<span id="L705"><span class="lineNum">     705</span>              :       for (; __first != __last; ++__first)</span>
<span id="L706"><span class="lineNum">     706</span>              :         if (__pred(*__first))</span>
<span id="L707"><span class="lineNum">     707</span>              :           {</span>
<span id="L708"><span class="lineNum">     708</span>              :             *__result = *__first;</span>
<span id="L709"><span class="lineNum">     709</span>              :             ++__result;</span>
<span id="L710"><span class="lineNum">     710</span>              :           }</span>
<span id="L711"><span class="lineNum">     711</span>              :       return __result;</span>
<span id="L712"><span class="lineNum">     712</span>              :     }</span>
<span id="L713"><span class="lineNum">     713</span>              : </span>
<span id="L714"><span class="lineNum">     714</span>              :   template&lt;typename _InputIterator, typename _Size, typename _OutputIterator&gt;</span>
<span id="L715"><span class="lineNum">     715</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L716"><span class="lineNum">     716</span>              :     _OutputIterator</span>
<span id="L717"><span class="lineNum">     717</span>              :     __copy_n(_InputIterator __first, _Size __n,</span>
<span id="L718"><span class="lineNum">     718</span>              :              _OutputIterator __result, input_iterator_tag)</span>
<span id="L719"><span class="lineNum">     719</span>              :     {</span>
<span id="L720"><span class="lineNum">     720</span>              :       return std::__niter_wrap(__result,</span>
<span id="L721"><span class="lineNum">     721</span>              :                                __copy_n_a(__first, __n,</span>
<span id="L722"><span class="lineNum">     722</span>              :                                           std::__niter_base(__result), true));</span>
<span id="L723"><span class="lineNum">     723</span>              :     }</span>
<span id="L724"><span class="lineNum">     724</span>              : </span>
<span id="L725"><span class="lineNum">     725</span>              :   template&lt;typename _RandomAccessIterator, typename _Size,</span>
<span id="L726"><span class="lineNum">     726</span>              :            typename _OutputIterator&gt;</span>
<span id="L727"><span class="lineNum">     727</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L728"><span class="lineNum">     728</span>              :     inline _OutputIterator</span>
<span id="L729"><span class="lineNum">     729</span>              :     __copy_n(_RandomAccessIterator __first, _Size __n,</span>
<span id="L730"><span class="lineNum">     730</span>              :              _OutputIterator __result, random_access_iterator_tag)</span>
<span id="L731"><span class="lineNum">     731</span>              :     { return std::copy(__first, __first + __n, __result); }</span>
<span id="L732"><span class="lineNum">     732</span>              : </span>
<span id="L733"><span class="lineNum">     733</span>              :   /**</span>
<span id="L734"><span class="lineNum">     734</span>              :    *  @brief Copies the range [first,first+n) into [result,result+n).</span>
<span id="L735"><span class="lineNum">     735</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L736"><span class="lineNum">     736</span>              :    *  @param  __first  An input iterator.</span>
<span id="L737"><span class="lineNum">     737</span>              :    *  @param  __n      The number of elements to copy.</span>
<span id="L738"><span class="lineNum">     738</span>              :    *  @param  __result An output iterator.</span>
<span id="L739"><span class="lineNum">     739</span>              :    *  @return  result+n.</span>
<span id="L740"><span class="lineNum">     740</span>              :    *</span>
<span id="L741"><span class="lineNum">     741</span>              :    *  This inline function will boil down to a call to @c memmove whenever</span>
<span id="L742"><span class="lineNum">     742</span>              :    *  possible.  Failing that, if random access iterators are passed, then the</span>
<span id="L743"><span class="lineNum">     743</span>              :    *  loop count will be known (and therefore a candidate for compiler</span>
<span id="L744"><span class="lineNum">     744</span>              :    *  optimizations such as unrolling).</span>
<span id="L745"><span class="lineNum">     745</span>              :   */</span>
<span id="L746"><span class="lineNum">     746</span>              :   template&lt;typename _InputIterator, typename _Size, typename _OutputIterator&gt;</span>
<span id="L747"><span class="lineNum">     747</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L748"><span class="lineNum">     748</span>              :     inline _OutputIterator</span>
<span id="L749"><span class="lineNum">     749</span>              :     copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)</span>
<span id="L750"><span class="lineNum">     750</span>              :     {</span>
<span id="L751"><span class="lineNum">     751</span>              :       // concept requirements</span>
<span id="L752"><span class="lineNum">     752</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L753"><span class="lineNum">     753</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L754"><span class="lineNum">     754</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L755"><span class="lineNum">     755</span>              : </span>
<span id="L756"><span class="lineNum">     756</span>              :       const auto __n2 = std::__size_to_integer(__n);</span>
<span id="L757"><span class="lineNum">     757</span>              :       if (__n2 &lt;= 0)</span>
<span id="L758"><span class="lineNum">     758</span>              :         return __result;</span>
<span id="L759"><span class="lineNum">     759</span>              : </span>
<span id="L760"><span class="lineNum">     760</span>              :       __glibcxx_requires_can_increment(__first, __n2);</span>
<span id="L761"><span class="lineNum">     761</span>              :       __glibcxx_requires_can_increment(__result, __n2);</span>
<span id="L762"><span class="lineNum">     762</span>              : </span>
<span id="L763"><span class="lineNum">     763</span>              :       return std::__copy_n(__first, __n2, __result,</span>
<span id="L764"><span class="lineNum">     764</span>              :                            std::__iterator_category(__first));</span>
<span id="L765"><span class="lineNum">     765</span>              :     }</span>
<span id="L766"><span class="lineNum">     766</span>              : </span>
<span id="L767"><span class="lineNum">     767</span>              :   /**</span>
<span id="L768"><span class="lineNum">     768</span>              :    *  @brief Copy the elements of a sequence to separate output sequences</span>
<span id="L769"><span class="lineNum">     769</span>              :    *         depending on the truth value of a predicate.</span>
<span id="L770"><span class="lineNum">     770</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L771"><span class="lineNum">     771</span>              :    *  @param  __first   An input iterator.</span>
<span id="L772"><span class="lineNum">     772</span>              :    *  @param  __last    An input iterator.</span>
<span id="L773"><span class="lineNum">     773</span>              :    *  @param  __out_true   An output iterator.</span>
<span id="L774"><span class="lineNum">     774</span>              :    *  @param  __out_false  An output iterator.</span>
<span id="L775"><span class="lineNum">     775</span>              :    *  @param  __pred    A predicate.</span>
<span id="L776"><span class="lineNum">     776</span>              :    *  @return   A pair designating the ends of the resulting sequences.</span>
<span id="L777"><span class="lineNum">     777</span>              :    *</span>
<span id="L778"><span class="lineNum">     778</span>              :    *  Copies each element in the range @p [__first,__last) for which</span>
<span id="L779"><span class="lineNum">     779</span>              :    *  @p __pred returns true to the range beginning at @p out_true</span>
<span id="L780"><span class="lineNum">     780</span>              :    *  and each element for which @p __pred returns false to @p __out_false.</span>
<span id="L781"><span class="lineNum">     781</span>              :   */</span>
<span id="L782"><span class="lineNum">     782</span>              :   template&lt;typename _InputIterator, typename _OutputIterator1,</span>
<span id="L783"><span class="lineNum">     783</span>              :            typename _OutputIterator2, typename _Predicate&gt;</span>
<span id="L784"><span class="lineNum">     784</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L785"><span class="lineNum">     785</span>              :     pair&lt;_OutputIterator1, _OutputIterator2&gt;</span>
<span id="L786"><span class="lineNum">     786</span>              :     partition_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L787"><span class="lineNum">     787</span>              :                    _OutputIterator1 __out_true, _OutputIterator2 __out_false,</span>
<span id="L788"><span class="lineNum">     788</span>              :                    _Predicate __pred)</span>
<span id="L789"><span class="lineNum">     789</span>              :     {</span>
<span id="L790"><span class="lineNum">     790</span>              :       // concept requirements</span>
<span id="L791"><span class="lineNum">     791</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L792"><span class="lineNum">     792</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator1,</span>
<span id="L793"><span class="lineNum">     793</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L794"><span class="lineNum">     794</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator2,</span>
<span id="L795"><span class="lineNum">     795</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L796"><span class="lineNum">     796</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L797"><span class="lineNum">     797</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L798"><span class="lineNum">     798</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L799"><span class="lineNum">     799</span>              :       </span>
<span id="L800"><span class="lineNum">     800</span>              :       for (; __first != __last; ++__first)</span>
<span id="L801"><span class="lineNum">     801</span>              :         if (__pred(*__first))</span>
<span id="L802"><span class="lineNum">     802</span>              :           {</span>
<span id="L803"><span class="lineNum">     803</span>              :             *__out_true = *__first;</span>
<span id="L804"><span class="lineNum">     804</span>              :             ++__out_true;</span>
<span id="L805"><span class="lineNum">     805</span>              :           }</span>
<span id="L806"><span class="lineNum">     806</span>              :         else</span>
<span id="L807"><span class="lineNum">     807</span>              :           {</span>
<span id="L808"><span class="lineNum">     808</span>              :             *__out_false = *__first;</span>
<span id="L809"><span class="lineNum">     809</span>              :             ++__out_false;</span>
<span id="L810"><span class="lineNum">     810</span>              :           }</span>
<span id="L811"><span class="lineNum">     811</span>              : </span>
<span id="L812"><span class="lineNum">     812</span>              :       return pair&lt;_OutputIterator1, _OutputIterator2&gt;(__out_true, __out_false);</span>
<span id="L813"><span class="lineNum">     813</span>              :     }</span>
<span id="L814"><span class="lineNum">     814</span>              : #endif // C++11</span>
<span id="L815"><span class="lineNum">     815</span>              : </span>
<span id="L816"><span class="lineNum">     816</span>              :   /**</span>
<span id="L817"><span class="lineNum">     817</span>              :    *  @brief Remove elements from a sequence.</span>
<span id="L818"><span class="lineNum">     818</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L819"><span class="lineNum">     819</span>              :    *  @param  __first  An input iterator.</span>
<span id="L820"><span class="lineNum">     820</span>              :    *  @param  __last   An input iterator.</span>
<span id="L821"><span class="lineNum">     821</span>              :    *  @param  __value  The value to be removed.</span>
<span id="L822"><span class="lineNum">     822</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L823"><span class="lineNum">     823</span>              :    *</span>
<span id="L824"><span class="lineNum">     824</span>              :    *  All elements equal to @p __value are removed from the range</span>
<span id="L825"><span class="lineNum">     825</span>              :    *  @p [__first,__last).</span>
<span id="L826"><span class="lineNum">     826</span>              :    *</span>
<span id="L827"><span class="lineNum">     827</span>              :    *  remove() is stable, so the relative order of elements that are</span>
<span id="L828"><span class="lineNum">     828</span>              :    *  not removed is unchanged.</span>
<span id="L829"><span class="lineNum">     829</span>              :    *</span>
<span id="L830"><span class="lineNum">     830</span>              :    *  Elements between the end of the resulting sequence and @p __last</span>
<span id="L831"><span class="lineNum">     831</span>              :    *  are still present, but their value is unspecified.</span>
<span id="L832"><span class="lineNum">     832</span>              :   */</span>
<span id="L833"><span class="lineNum">     833</span>              :   template&lt;typename _ForwardIterator, typename _Tp&gt;</span>
<span id="L834"><span class="lineNum">     834</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L835"><span class="lineNum">     835</span>              :     inline _ForwardIterator</span>
<span id="L836"><span class="lineNum">     836</span>              :     remove(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L837"><span class="lineNum">     837</span>              :            const _Tp&amp; __value)</span>
<span id="L838"><span class="lineNum">     838</span>              :     {</span>
<span id="L839"><span class="lineNum">     839</span>              :       // concept requirements</span>
<span id="L840"><span class="lineNum">     840</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L841"><span class="lineNum">     841</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L842"><span class="lineNum">     842</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L843"><span class="lineNum">     843</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L844"><span class="lineNum">     844</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L845"><span class="lineNum">     845</span>              : </span>
<span id="L846"><span class="lineNum">     846</span>              :       return std::__remove_if(__first, __last,</span>
<span id="L847"><span class="lineNum">     847</span>              :                 __gnu_cxx::__ops::__iter_equals_val(__value));</span>
<span id="L848"><span class="lineNum">     848</span>              :     }</span>
<span id="L849"><span class="lineNum">     849</span>              : </span>
<span id="L850"><span class="lineNum">     850</span>              :   /**</span>
<span id="L851"><span class="lineNum">     851</span>              :    *  @brief Remove elements from a sequence using a predicate.</span>
<span id="L852"><span class="lineNum">     852</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L853"><span class="lineNum">     853</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L854"><span class="lineNum">     854</span>              :    *  @param  __last   A forward iterator.</span>
<span id="L855"><span class="lineNum">     855</span>              :    *  @param  __pred   A predicate.</span>
<span id="L856"><span class="lineNum">     856</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L857"><span class="lineNum">     857</span>              :    *</span>
<span id="L858"><span class="lineNum">     858</span>              :    *  All elements for which @p __pred returns true are removed from the range</span>
<span id="L859"><span class="lineNum">     859</span>              :    *  @p [__first,__last).</span>
<span id="L860"><span class="lineNum">     860</span>              :    *</span>
<span id="L861"><span class="lineNum">     861</span>              :    *  remove_if() is stable, so the relative order of elements that are</span>
<span id="L862"><span class="lineNum">     862</span>              :    *  not removed is unchanged.</span>
<span id="L863"><span class="lineNum">     863</span>              :    *</span>
<span id="L864"><span class="lineNum">     864</span>              :    *  Elements between the end of the resulting sequence and @p __last</span>
<span id="L865"><span class="lineNum">     865</span>              :    *  are still present, but their value is unspecified.</span>
<span id="L866"><span class="lineNum">     866</span>              :   */</span>
<span id="L867"><span class="lineNum">     867</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L868"><span class="lineNum">     868</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L869"><span class="lineNum">     869</span>              :     inline _ForwardIterator</span>
<span id="L870"><span class="lineNum">     870</span> <span class="tlaUNC tlaBgUNC">           0 :     remove_if(_ForwardIterator __first, _ForwardIterator __last,</span></span>
<span id="L871"><span class="lineNum">     871</span>              :               _Predicate __pred)</span>
<span id="L872"><span class="lineNum">     872</span>              :     {</span>
<span id="L873"><span class="lineNum">     873</span>              :       // concept requirements</span>
<span id="L874"><span class="lineNum">     874</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L875"><span class="lineNum">     875</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L876"><span class="lineNum">     876</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L877"><span class="lineNum">     877</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L878"><span class="lineNum">     878</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L879"><span class="lineNum">     879</span>              : </span>
<span id="L880"><span class="lineNum">     880</span> <span class="tlaUNC">           0 :       return std::__remove_if(__first, __last,</span></span>
<span id="L881"><span class="lineNum">     881</span> <span class="tlaUNC">           0 :                               __gnu_cxx::__ops::__pred_iter(__pred));</span></span>
<span id="L882"><span class="lineNum">     882</span>              :     }</span>
<span id="L883"><span class="lineNum">     883</span>              : </span>
<span id="L884"><span class="lineNum">     884</span>              :   template&lt;typename _ForwardIterator, typename _BinaryPredicate&gt;</span>
<span id="L885"><span class="lineNum">     885</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L886"><span class="lineNum">     886</span>              :     _ForwardIterator</span>
<span id="L887"><span class="lineNum">     887</span>              :     __adjacent_find(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L888"><span class="lineNum">     888</span>              :                     _BinaryPredicate __binary_pred)</span>
<span id="L889"><span class="lineNum">     889</span>              :     {</span>
<span id="L890"><span class="lineNum">     890</span>              :       if (__first == __last)</span>
<span id="L891"><span class="lineNum">     891</span>              :         return __last;</span>
<span id="L892"><span class="lineNum">     892</span>              :       _ForwardIterator __next = __first;</span>
<span id="L893"><span class="lineNum">     893</span>              :       while (++__next != __last)</span>
<span id="L894"><span class="lineNum">     894</span>              :         {</span>
<span id="L895"><span class="lineNum">     895</span>              :           if (__binary_pred(__first, __next))</span>
<span id="L896"><span class="lineNum">     896</span>              :             return __first;</span>
<span id="L897"><span class="lineNum">     897</span>              :           __first = __next;</span>
<span id="L898"><span class="lineNum">     898</span>              :         }</span>
<span id="L899"><span class="lineNum">     899</span>              :       return __last;</span>
<span id="L900"><span class="lineNum">     900</span>              :     }</span>
<span id="L901"><span class="lineNum">     901</span>              : </span>
<span id="L902"><span class="lineNum">     902</span>              :   template&lt;typename _ForwardIterator, typename _BinaryPredicate&gt;</span>
<span id="L903"><span class="lineNum">     903</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L904"><span class="lineNum">     904</span>              :     _ForwardIterator</span>
<span id="L905"><span class="lineNum">     905</span>              :     __unique(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L906"><span class="lineNum">     906</span>              :              _BinaryPredicate __binary_pred)</span>
<span id="L907"><span class="lineNum">     907</span>              :     {</span>
<span id="L908"><span class="lineNum">     908</span>              :       // Skip the beginning, if already unique.</span>
<span id="L909"><span class="lineNum">     909</span>              :       __first = std::__adjacent_find(__first, __last, __binary_pred);</span>
<span id="L910"><span class="lineNum">     910</span>              :       if (__first == __last)</span>
<span id="L911"><span class="lineNum">     911</span>              :         return __last;</span>
<span id="L912"><span class="lineNum">     912</span>              : </span>
<span id="L913"><span class="lineNum">     913</span>              :       // Do the real copy work.</span>
<span id="L914"><span class="lineNum">     914</span>              :       _ForwardIterator __dest = __first;</span>
<span id="L915"><span class="lineNum">     915</span>              :       ++__first;</span>
<span id="L916"><span class="lineNum">     916</span>              :       while (++__first != __last)</span>
<span id="L917"><span class="lineNum">     917</span>              :         if (!__binary_pred(__dest, __first))</span>
<span id="L918"><span class="lineNum">     918</span>              :           *++__dest = _GLIBCXX_MOVE(*__first);</span>
<span id="L919"><span class="lineNum">     919</span>              :       return ++__dest;</span>
<span id="L920"><span class="lineNum">     920</span>              :     }</span>
<span id="L921"><span class="lineNum">     921</span>              : </span>
<span id="L922"><span class="lineNum">     922</span>              :   /**</span>
<span id="L923"><span class="lineNum">     923</span>              :    *  @brief Remove consecutive duplicate values from a sequence.</span>
<span id="L924"><span class="lineNum">     924</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L925"><span class="lineNum">     925</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L926"><span class="lineNum">     926</span>              :    *  @param  __last   A forward iterator.</span>
<span id="L927"><span class="lineNum">     927</span>              :    *  @return  An iterator designating the end of the resulting sequence.</span>
<span id="L928"><span class="lineNum">     928</span>              :    *</span>
<span id="L929"><span class="lineNum">     929</span>              :    *  Removes all but the first element from each group of consecutive</span>
<span id="L930"><span class="lineNum">     930</span>              :    *  values that compare equal.</span>
<span id="L931"><span class="lineNum">     931</span>              :    *  unique() is stable, so the relative order of elements that are</span>
<span id="L932"><span class="lineNum">     932</span>              :    *  not removed is unchanged.</span>
<span id="L933"><span class="lineNum">     933</span>              :    *  Elements between the end of the resulting sequence and @p __last</span>
<span id="L934"><span class="lineNum">     934</span>              :    *  are still present, but their value is unspecified.</span>
<span id="L935"><span class="lineNum">     935</span>              :   */</span>
<span id="L936"><span class="lineNum">     936</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L937"><span class="lineNum">     937</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L938"><span class="lineNum">     938</span>              :     inline _ForwardIterator</span>
<span id="L939"><span class="lineNum">     939</span>              :     unique(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L940"><span class="lineNum">     940</span>              :     {</span>
<span id="L941"><span class="lineNum">     941</span>              :       // concept requirements</span>
<span id="L942"><span class="lineNum">     942</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L943"><span class="lineNum">     943</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L944"><span class="lineNum">     944</span>              :       __glibcxx_function_requires(_EqualityComparableConcept&lt;</span>
<span id="L945"><span class="lineNum">     945</span>              :                      typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L946"><span class="lineNum">     946</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L947"><span class="lineNum">     947</span>              : </span>
<span id="L948"><span class="lineNum">     948</span>              :       return std::__unique(__first, __last,</span>
<span id="L949"><span class="lineNum">     949</span>              :                            __gnu_cxx::__ops::__iter_equal_to_iter());</span>
<span id="L950"><span class="lineNum">     950</span>              :     }</span>
<span id="L951"><span class="lineNum">     951</span>              : </span>
<span id="L952"><span class="lineNum">     952</span>              :   /**</span>
<span id="L953"><span class="lineNum">     953</span>              :    *  @brief Remove consecutive values from a sequence using a predicate.</span>
<span id="L954"><span class="lineNum">     954</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L955"><span class="lineNum">     955</span>              :    *  @param  __first        A forward iterator.</span>
<span id="L956"><span class="lineNum">     956</span>              :    *  @param  __last         A forward iterator.</span>
<span id="L957"><span class="lineNum">     957</span>              :    *  @param  __binary_pred  A binary predicate.</span>
<span id="L958"><span class="lineNum">     958</span>              :    *  @return  An iterator designating the end of the resulting sequence.</span>
<span id="L959"><span class="lineNum">     959</span>              :    *</span>
<span id="L960"><span class="lineNum">     960</span>              :    *  Removes all but the first element from each group of consecutive</span>
<span id="L961"><span class="lineNum">     961</span>              :    *  values for which @p __binary_pred returns true.</span>
<span id="L962"><span class="lineNum">     962</span>              :    *  unique() is stable, so the relative order of elements that are</span>
<span id="L963"><span class="lineNum">     963</span>              :    *  not removed is unchanged.</span>
<span id="L964"><span class="lineNum">     964</span>              :    *  Elements between the end of the resulting sequence and @p __last</span>
<span id="L965"><span class="lineNum">     965</span>              :    *  are still present, but their value is unspecified.</span>
<span id="L966"><span class="lineNum">     966</span>              :   */</span>
<span id="L967"><span class="lineNum">     967</span>              :   template&lt;typename _ForwardIterator, typename _BinaryPredicate&gt;</span>
<span id="L968"><span class="lineNum">     968</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L969"><span class="lineNum">     969</span>              :     inline _ForwardIterator</span>
<span id="L970"><span class="lineNum">     970</span>              :     unique(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L971"><span class="lineNum">     971</span>              :            _BinaryPredicate __binary_pred)</span>
<span id="L972"><span class="lineNum">     972</span>              :     {</span>
<span id="L973"><span class="lineNum">     973</span>              :       // concept requirements</span>
<span id="L974"><span class="lineNum">     974</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L975"><span class="lineNum">     975</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L976"><span class="lineNum">     976</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L977"><span class="lineNum">     977</span>              :                 typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L978"><span class="lineNum">     978</span>              :                 typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L979"><span class="lineNum">     979</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L980"><span class="lineNum">     980</span>              : </span>
<span id="L981"><span class="lineNum">     981</span>              :       return std::__unique(__first, __last,</span>
<span id="L982"><span class="lineNum">     982</span>              :                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));</span>
<span id="L983"><span class="lineNum">     983</span>              :     }</span>
<span id="L984"><span class="lineNum">     984</span>              : </span>
<span id="L985"><span class="lineNum">     985</span>              :   /**</span>
<span id="L986"><span class="lineNum">     986</span>              :    *  This is an uglified</span>
<span id="L987"><span class="lineNum">     987</span>              :    *  unique_copy(_InputIterator, _InputIterator, _OutputIterator,</span>
<span id="L988"><span class="lineNum">     988</span>              :    *              _BinaryPredicate)</span>
<span id="L989"><span class="lineNum">     989</span>              :    *  overloaded for forward iterators and output iterator as result.</span>
<span id="L990"><span class="lineNum">     990</span>              :   */</span>
<span id="L991"><span class="lineNum">     991</span>              :   template&lt;typename _ForwardIterator, typename _OutputIterator,</span>
<span id="L992"><span class="lineNum">     992</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L993"><span class="lineNum">     993</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L994"><span class="lineNum">     994</span>              :     _OutputIterator</span>
<span id="L995"><span class="lineNum">     995</span>              :     __unique_copy(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L996"><span class="lineNum">     996</span>              :                   _OutputIterator __result, _BinaryPredicate __binary_pred,</span>
<span id="L997"><span class="lineNum">     997</span>              :                   forward_iterator_tag, output_iterator_tag)</span>
<span id="L998"><span class="lineNum">     998</span>              :     {</span>
<span id="L999"><span class="lineNum">     999</span>              :       // concept requirements -- iterators already checked</span>
<span id="L1000"><span class="lineNum">    1000</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L1001"><span class="lineNum">    1001</span>              :           typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L1002"><span class="lineNum">    1002</span>              :           typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L1003"><span class="lineNum">    1003</span>              : </span>
<span id="L1004"><span class="lineNum">    1004</span>              :       _ForwardIterator __next = __first;</span>
<span id="L1005"><span class="lineNum">    1005</span>              :       *__result = *__first;</span>
<span id="L1006"><span class="lineNum">    1006</span>              :       while (++__next != __last)</span>
<span id="L1007"><span class="lineNum">    1007</span>              :         if (!__binary_pred(__first, __next))</span>
<span id="L1008"><span class="lineNum">    1008</span>              :           {</span>
<span id="L1009"><span class="lineNum">    1009</span>              :             __first = __next;</span>
<span id="L1010"><span class="lineNum">    1010</span>              :             *++__result = *__first;</span>
<span id="L1011"><span class="lineNum">    1011</span>              :           }</span>
<span id="L1012"><span class="lineNum">    1012</span>              :       return ++__result;</span>
<span id="L1013"><span class="lineNum">    1013</span>              :     }</span>
<span id="L1014"><span class="lineNum">    1014</span>              : </span>
<span id="L1015"><span class="lineNum">    1015</span>              :   /**</span>
<span id="L1016"><span class="lineNum">    1016</span>              :    *  This is an uglified</span>
<span id="L1017"><span class="lineNum">    1017</span>              :    *  unique_copy(_InputIterator, _InputIterator, _OutputIterator,</span>
<span id="L1018"><span class="lineNum">    1018</span>              :    *              _BinaryPredicate)</span>
<span id="L1019"><span class="lineNum">    1019</span>              :    *  overloaded for input iterators and output iterator as result.</span>
<span id="L1020"><span class="lineNum">    1020</span>              :   */</span>
<span id="L1021"><span class="lineNum">    1021</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L1022"><span class="lineNum">    1022</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L1023"><span class="lineNum">    1023</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1024"><span class="lineNum">    1024</span>              :     _OutputIterator</span>
<span id="L1025"><span class="lineNum">    1025</span>              :     __unique_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L1026"><span class="lineNum">    1026</span>              :                   _OutputIterator __result, _BinaryPredicate __binary_pred,</span>
<span id="L1027"><span class="lineNum">    1027</span>              :                   input_iterator_tag, output_iterator_tag)</span>
<span id="L1028"><span class="lineNum">    1028</span>              :     {</span>
<span id="L1029"><span class="lineNum">    1029</span>              :       // concept requirements -- iterators already checked</span>
<span id="L1030"><span class="lineNum">    1030</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L1031"><span class="lineNum">    1031</span>              :           typename iterator_traits&lt;_InputIterator&gt;::value_type,</span>
<span id="L1032"><span class="lineNum">    1032</span>              :           typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L1033"><span class="lineNum">    1033</span>              : </span>
<span id="L1034"><span class="lineNum">    1034</span>              :       typename iterator_traits&lt;_InputIterator&gt;::value_type __value = *__first;</span>
<span id="L1035"><span class="lineNum">    1035</span>              :       __decltype(__gnu_cxx::__ops::__iter_comp_val(__binary_pred))</span>
<span id="L1036"><span class="lineNum">    1036</span>              :         __rebound_pred</span>
<span id="L1037"><span class="lineNum">    1037</span>              :         = __gnu_cxx::__ops::__iter_comp_val(__binary_pred);</span>
<span id="L1038"><span class="lineNum">    1038</span>              :       *__result = __value;</span>
<span id="L1039"><span class="lineNum">    1039</span>              :       while (++__first != __last)</span>
<span id="L1040"><span class="lineNum">    1040</span>              :         if (!__rebound_pred(__first, __value))</span>
<span id="L1041"><span class="lineNum">    1041</span>              :           {</span>
<span id="L1042"><span class="lineNum">    1042</span>              :             __value = *__first;</span>
<span id="L1043"><span class="lineNum">    1043</span>              :             *++__result = __value;</span>
<span id="L1044"><span class="lineNum">    1044</span>              :           }</span>
<span id="L1045"><span class="lineNum">    1045</span>              :       return ++__result;</span>
<span id="L1046"><span class="lineNum">    1046</span>              :     }</span>
<span id="L1047"><span class="lineNum">    1047</span>              : </span>
<span id="L1048"><span class="lineNum">    1048</span>              :   /**</span>
<span id="L1049"><span class="lineNum">    1049</span>              :    *  This is an uglified</span>
<span id="L1050"><span class="lineNum">    1050</span>              :    *  unique_copy(_InputIterator, _InputIterator, _OutputIterator,</span>
<span id="L1051"><span class="lineNum">    1051</span>              :    *              _BinaryPredicate)</span>
<span id="L1052"><span class="lineNum">    1052</span>              :    *  overloaded for input iterators and forward iterator as result.</span>
<span id="L1053"><span class="lineNum">    1053</span>              :   */</span>
<span id="L1054"><span class="lineNum">    1054</span>              :   template&lt;typename _InputIterator, typename _ForwardIterator,</span>
<span id="L1055"><span class="lineNum">    1055</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L1056"><span class="lineNum">    1056</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1057"><span class="lineNum">    1057</span>              :     _ForwardIterator</span>
<span id="L1058"><span class="lineNum">    1058</span>              :     __unique_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L1059"><span class="lineNum">    1059</span>              :                   _ForwardIterator __result, _BinaryPredicate __binary_pred,</span>
<span id="L1060"><span class="lineNum">    1060</span>              :                   input_iterator_tag, forward_iterator_tag)</span>
<span id="L1061"><span class="lineNum">    1061</span>              :     {</span>
<span id="L1062"><span class="lineNum">    1062</span>              :       // concept requirements -- iterators already checked</span>
<span id="L1063"><span class="lineNum">    1063</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L1064"><span class="lineNum">    1064</span>              :           typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L1065"><span class="lineNum">    1065</span>              :           typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L1066"><span class="lineNum">    1066</span>              :       *__result = *__first;</span>
<span id="L1067"><span class="lineNum">    1067</span>              :       while (++__first != __last)</span>
<span id="L1068"><span class="lineNum">    1068</span>              :         if (!__binary_pred(__result, __first))</span>
<span id="L1069"><span class="lineNum">    1069</span>              :           *++__result = *__first;</span>
<span id="L1070"><span class="lineNum">    1070</span>              :       return ++__result;</span>
<span id="L1071"><span class="lineNum">    1071</span>              :     }</span>
<span id="L1072"><span class="lineNum">    1072</span>              : </span>
<span id="L1073"><span class="lineNum">    1073</span>              :   /**</span>
<span id="L1074"><span class="lineNum">    1074</span>              :    *  This is an uglified reverse(_BidirectionalIterator,</span>
<span id="L1075"><span class="lineNum">    1075</span>              :    *                              _BidirectionalIterator)</span>
<span id="L1076"><span class="lineNum">    1076</span>              :    *  overloaded for bidirectional iterators.</span>
<span id="L1077"><span class="lineNum">    1077</span>              :   */</span>
<span id="L1078"><span class="lineNum">    1078</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L1079"><span class="lineNum">    1079</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1080"><span class="lineNum">    1080</span>              :     void</span>
<span id="L1081"><span class="lineNum">    1081</span>              :     __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,</span>
<span id="L1082"><span class="lineNum">    1082</span>              :               bidirectional_iterator_tag)</span>
<span id="L1083"><span class="lineNum">    1083</span>              :     {</span>
<span id="L1084"><span class="lineNum">    1084</span>              :       while (true)</span>
<span id="L1085"><span class="lineNum">    1085</span>              :         if (__first == __last || __first == --__last)</span>
<span id="L1086"><span class="lineNum">    1086</span>              :           return;</span>
<span id="L1087"><span class="lineNum">    1087</span>              :         else</span>
<span id="L1088"><span class="lineNum">    1088</span>              :           {</span>
<span id="L1089"><span class="lineNum">    1089</span>              :             std::iter_swap(__first, __last);</span>
<span id="L1090"><span class="lineNum">    1090</span>              :             ++__first;</span>
<span id="L1091"><span class="lineNum">    1091</span>              :           }</span>
<span id="L1092"><span class="lineNum">    1092</span>              :     }</span>
<span id="L1093"><span class="lineNum">    1093</span>              : </span>
<span id="L1094"><span class="lineNum">    1094</span>              :   /**</span>
<span id="L1095"><span class="lineNum">    1095</span>              :    *  This is an uglified reverse(_BidirectionalIterator,</span>
<span id="L1096"><span class="lineNum">    1096</span>              :    *                              _BidirectionalIterator)</span>
<span id="L1097"><span class="lineNum">    1097</span>              :    *  overloaded for random access iterators.</span>
<span id="L1098"><span class="lineNum">    1098</span>              :   */</span>
<span id="L1099"><span class="lineNum">    1099</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L1100"><span class="lineNum">    1100</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1101"><span class="lineNum">    1101</span>              :     void</span>
<span id="L1102"><span class="lineNum">    1102</span>              :     __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L1103"><span class="lineNum">    1103</span>              :               random_access_iterator_tag)</span>
<span id="L1104"><span class="lineNum">    1104</span>              :     {</span>
<span id="L1105"><span class="lineNum">    1105</span>              :       if (__first == __last)</span>
<span id="L1106"><span class="lineNum">    1106</span>              :         return;</span>
<span id="L1107"><span class="lineNum">    1107</span>              :       --__last;</span>
<span id="L1108"><span class="lineNum">    1108</span>              :       while (__first &lt; __last)</span>
<span id="L1109"><span class="lineNum">    1109</span>              :         {</span>
<span id="L1110"><span class="lineNum">    1110</span>              :           std::iter_swap(__first, __last);</span>
<span id="L1111"><span class="lineNum">    1111</span>              :           ++__first;</span>
<span id="L1112"><span class="lineNum">    1112</span>              :           --__last;</span>
<span id="L1113"><span class="lineNum">    1113</span>              :         }</span>
<span id="L1114"><span class="lineNum">    1114</span>              :     }</span>
<span id="L1115"><span class="lineNum">    1115</span>              : </span>
<span id="L1116"><span class="lineNum">    1116</span>              :   /**</span>
<span id="L1117"><span class="lineNum">    1117</span>              :    *  @brief Reverse a sequence.</span>
<span id="L1118"><span class="lineNum">    1118</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L1119"><span class="lineNum">    1119</span>              :    *  @param  __first  A bidirectional iterator.</span>
<span id="L1120"><span class="lineNum">    1120</span>              :    *  @param  __last   A bidirectional iterator.</span>
<span id="L1121"><span class="lineNum">    1121</span>              :    *  @return   reverse() returns no value.</span>
<span id="L1122"><span class="lineNum">    1122</span>              :    *</span>
<span id="L1123"><span class="lineNum">    1123</span>              :    *  Reverses the order of the elements in the range @p [__first,__last),</span>
<span id="L1124"><span class="lineNum">    1124</span>              :    *  so that the first element becomes the last etc.</span>
<span id="L1125"><span class="lineNum">    1125</span>              :    *  For every @c i such that @p 0&lt;=i&lt;=(__last-__first)/2), @p reverse()</span>
<span id="L1126"><span class="lineNum">    1126</span>              :    *  swaps @p *(__first+i) and @p *(__last-(i+1))</span>
<span id="L1127"><span class="lineNum">    1127</span>              :   */</span>
<span id="L1128"><span class="lineNum">    1128</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L1129"><span class="lineNum">    1129</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1130"><span class="lineNum">    1130</span>              :     inline void</span>
<span id="L1131"><span class="lineNum">    1131</span>              :     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)</span>
<span id="L1132"><span class="lineNum">    1132</span>              :     {</span>
<span id="L1133"><span class="lineNum">    1133</span>              :       // concept requirements</span>
<span id="L1134"><span class="lineNum">    1134</span>              :       __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept&lt;</span>
<span id="L1135"><span class="lineNum">    1135</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L1136"><span class="lineNum">    1136</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L1137"><span class="lineNum">    1137</span>              :       std::__reverse(__first, __last, std::__iterator_category(__first));</span>
<span id="L1138"><span class="lineNum">    1138</span>              :     }</span>
<span id="L1139"><span class="lineNum">    1139</span>              : </span>
<span id="L1140"><span class="lineNum">    1140</span>              :   /**</span>
<span id="L1141"><span class="lineNum">    1141</span>              :    *  @brief Copy a sequence, reversing its elements.</span>
<span id="L1142"><span class="lineNum">    1142</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L1143"><span class="lineNum">    1143</span>              :    *  @param  __first   A bidirectional iterator.</span>
<span id="L1144"><span class="lineNum">    1144</span>              :    *  @param  __last    A bidirectional iterator.</span>
<span id="L1145"><span class="lineNum">    1145</span>              :    *  @param  __result  An output iterator.</span>
<span id="L1146"><span class="lineNum">    1146</span>              :    *  @return  An iterator designating the end of the resulting sequence.</span>
<span id="L1147"><span class="lineNum">    1147</span>              :    *</span>
<span id="L1148"><span class="lineNum">    1148</span>              :    *  Copies the elements in the range @p [__first,__last) to the</span>
<span id="L1149"><span class="lineNum">    1149</span>              :    *  range @p [__result,__result+(__last-__first)) such that the</span>
<span id="L1150"><span class="lineNum">    1150</span>              :    *  order of the elements is reversed.  For every @c i such that @p</span>
<span id="L1151"><span class="lineNum">    1151</span>              :    *  0&lt;=i&lt;=(__last-__first), @p reverse_copy() performs the</span>
<span id="L1152"><span class="lineNum">    1152</span>              :    *  assignment @p *(__result+(__last-__first)-1-i) = *(__first+i).</span>
<span id="L1153"><span class="lineNum">    1153</span>              :    *  The ranges @p [__first,__last) and @p</span>
<span id="L1154"><span class="lineNum">    1154</span>              :    *  [__result,__result+(__last-__first)) must not overlap.</span>
<span id="L1155"><span class="lineNum">    1155</span>              :   */</span>
<span id="L1156"><span class="lineNum">    1156</span>              :   template&lt;typename _BidirectionalIterator, typename _OutputIterator&gt;</span>
<span id="L1157"><span class="lineNum">    1157</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1158"><span class="lineNum">    1158</span>              :     _OutputIterator</span>
<span id="L1159"><span class="lineNum">    1159</span>              :     reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,</span>
<span id="L1160"><span class="lineNum">    1160</span>              :                  _OutputIterator __result)</span>
<span id="L1161"><span class="lineNum">    1161</span>              :     {</span>
<span id="L1162"><span class="lineNum">    1162</span>              :       // concept requirements</span>
<span id="L1163"><span class="lineNum">    1163</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L1164"><span class="lineNum">    1164</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L1165"><span class="lineNum">    1165</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L1166"><span class="lineNum">    1166</span>              :                 typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L1167"><span class="lineNum">    1167</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L1168"><span class="lineNum">    1168</span>              : </span>
<span id="L1169"><span class="lineNum">    1169</span>              :       while (__first != __last)</span>
<span id="L1170"><span class="lineNum">    1170</span>              :         {</span>
<span id="L1171"><span class="lineNum">    1171</span>              :           --__last;</span>
<span id="L1172"><span class="lineNum">    1172</span>              :           *__result = *__last;</span>
<span id="L1173"><span class="lineNum">    1173</span>              :           ++__result;</span>
<span id="L1174"><span class="lineNum">    1174</span>              :         }</span>
<span id="L1175"><span class="lineNum">    1175</span>              :       return __result;</span>
<span id="L1176"><span class="lineNum">    1176</span>              :     }</span>
<span id="L1177"><span class="lineNum">    1177</span>              : </span>
<span id="L1178"><span class="lineNum">    1178</span>              :   /**</span>
<span id="L1179"><span class="lineNum">    1179</span>              :    *  This is a helper function for the rotate algorithm specialized on RAIs.</span>
<span id="L1180"><span class="lineNum">    1180</span>              :    *  It returns the greatest common divisor of two integer values.</span>
<span id="L1181"><span class="lineNum">    1181</span>              :   */</span>
<span id="L1182"><span class="lineNum">    1182</span>              :   template&lt;typename _EuclideanRingElement&gt;</span>
<span id="L1183"><span class="lineNum">    1183</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1184"><span class="lineNum">    1184</span>              :     _EuclideanRingElement</span>
<span id="L1185"><span class="lineNum">    1185</span>              :     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)</span>
<span id="L1186"><span class="lineNum">    1186</span>              :     {</span>
<span id="L1187"><span class="lineNum">    1187</span>              :       while (__n != 0)</span>
<span id="L1188"><span class="lineNum">    1188</span>              :         {</span>
<span id="L1189"><span class="lineNum">    1189</span>              :           _EuclideanRingElement __t = __m % __n;</span>
<span id="L1190"><span class="lineNum">    1190</span>              :           __m = __n;</span>
<span id="L1191"><span class="lineNum">    1191</span>              :           __n = __t;</span>
<span id="L1192"><span class="lineNum">    1192</span>              :         }</span>
<span id="L1193"><span class="lineNum">    1193</span>              :       return __m;</span>
<span id="L1194"><span class="lineNum">    1194</span>              :     }</span>
<span id="L1195"><span class="lineNum">    1195</span>              : </span>
<span id="L1196"><span class="lineNum">    1196</span>              : _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)</span>
<span id="L1197"><span class="lineNum">    1197</span>              : </span>
<span id="L1198"><span class="lineNum">    1198</span>              :   /// This is a helper function for the rotate algorithm.</span>
<span id="L1199"><span class="lineNum">    1199</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L1200"><span class="lineNum">    1200</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1201"><span class="lineNum">    1201</span>              :     _ForwardIterator</span>
<span id="L1202"><span class="lineNum">    1202</span>              :     __rotate(_ForwardIterator __first,</span>
<span id="L1203"><span class="lineNum">    1203</span>              :              _ForwardIterator __middle,</span>
<span id="L1204"><span class="lineNum">    1204</span>              :              _ForwardIterator __last,</span>
<span id="L1205"><span class="lineNum">    1205</span>              :              forward_iterator_tag)</span>
<span id="L1206"><span class="lineNum">    1206</span>              :     {</span>
<span id="L1207"><span class="lineNum">    1207</span>              :       if (__first == __middle)</span>
<span id="L1208"><span class="lineNum">    1208</span>              :         return __last;</span>
<span id="L1209"><span class="lineNum">    1209</span>              :       else if (__last == __middle)</span>
<span id="L1210"><span class="lineNum">    1210</span>              :         return __first;</span>
<span id="L1211"><span class="lineNum">    1211</span>              : </span>
<span id="L1212"><span class="lineNum">    1212</span>              :       _ForwardIterator __first2 = __middle;</span>
<span id="L1213"><span class="lineNum">    1213</span>              :       do</span>
<span id="L1214"><span class="lineNum">    1214</span>              :         {</span>
<span id="L1215"><span class="lineNum">    1215</span>              :           std::iter_swap(__first, __first2);</span>
<span id="L1216"><span class="lineNum">    1216</span>              :           ++__first;</span>
<span id="L1217"><span class="lineNum">    1217</span>              :           ++__first2;</span>
<span id="L1218"><span class="lineNum">    1218</span>              :           if (__first == __middle)</span>
<span id="L1219"><span class="lineNum">    1219</span>              :             __middle = __first2;</span>
<span id="L1220"><span class="lineNum">    1220</span>              :         }</span>
<span id="L1221"><span class="lineNum">    1221</span>              :       while (__first2 != __last);</span>
<span id="L1222"><span class="lineNum">    1222</span>              : </span>
<span id="L1223"><span class="lineNum">    1223</span>              :       _ForwardIterator __ret = __first;</span>
<span id="L1224"><span class="lineNum">    1224</span>              : </span>
<span id="L1225"><span class="lineNum">    1225</span>              :       __first2 = __middle;</span>
<span id="L1226"><span class="lineNum">    1226</span>              : </span>
<span id="L1227"><span class="lineNum">    1227</span>              :       while (__first2 != __last)</span>
<span id="L1228"><span class="lineNum">    1228</span>              :         {</span>
<span id="L1229"><span class="lineNum">    1229</span>              :           std::iter_swap(__first, __first2);</span>
<span id="L1230"><span class="lineNum">    1230</span>              :           ++__first;</span>
<span id="L1231"><span class="lineNum">    1231</span>              :           ++__first2;</span>
<span id="L1232"><span class="lineNum">    1232</span>              :           if (__first == __middle)</span>
<span id="L1233"><span class="lineNum">    1233</span>              :             __middle = __first2;</span>
<span id="L1234"><span class="lineNum">    1234</span>              :           else if (__first2 == __last)</span>
<span id="L1235"><span class="lineNum">    1235</span>              :             __first2 = __middle;</span>
<span id="L1236"><span class="lineNum">    1236</span>              :         }</span>
<span id="L1237"><span class="lineNum">    1237</span>              :       return __ret;</span>
<span id="L1238"><span class="lineNum">    1238</span>              :     }</span>
<span id="L1239"><span class="lineNum">    1239</span>              : </span>
<span id="L1240"><span class="lineNum">    1240</span>              :    /// This is a helper function for the rotate algorithm.</span>
<span id="L1241"><span class="lineNum">    1241</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L1242"><span class="lineNum">    1242</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1243"><span class="lineNum">    1243</span>              :     _BidirectionalIterator</span>
<span id="L1244"><span class="lineNum">    1244</span>              :     __rotate(_BidirectionalIterator __first,</span>
<span id="L1245"><span class="lineNum">    1245</span>              :              _BidirectionalIterator __middle,</span>
<span id="L1246"><span class="lineNum">    1246</span>              :              _BidirectionalIterator __last,</span>
<span id="L1247"><span class="lineNum">    1247</span>              :               bidirectional_iterator_tag)</span>
<span id="L1248"><span class="lineNum">    1248</span>              :     {</span>
<span id="L1249"><span class="lineNum">    1249</span>              :       // concept requirements</span>
<span id="L1250"><span class="lineNum">    1250</span>              :       __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept&lt;</span>
<span id="L1251"><span class="lineNum">    1251</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L1252"><span class="lineNum">    1252</span>              : </span>
<span id="L1253"><span class="lineNum">    1253</span>              :       if (__first == __middle)</span>
<span id="L1254"><span class="lineNum">    1254</span>              :         return __last;</span>
<span id="L1255"><span class="lineNum">    1255</span>              :       else if (__last == __middle)</span>
<span id="L1256"><span class="lineNum">    1256</span>              :         return __first;</span>
<span id="L1257"><span class="lineNum">    1257</span>              : </span>
<span id="L1258"><span class="lineNum">    1258</span>              :       std::__reverse(__first,  __middle, bidirectional_iterator_tag());</span>
<span id="L1259"><span class="lineNum">    1259</span>              :       std::__reverse(__middle, __last,   bidirectional_iterator_tag());</span>
<span id="L1260"><span class="lineNum">    1260</span>              : </span>
<span id="L1261"><span class="lineNum">    1261</span>              :       while (__first != __middle &amp;&amp; __middle != __last)</span>
<span id="L1262"><span class="lineNum">    1262</span>              :         {</span>
<span id="L1263"><span class="lineNum">    1263</span>              :           std::iter_swap(__first, --__last);</span>
<span id="L1264"><span class="lineNum">    1264</span>              :           ++__first;</span>
<span id="L1265"><span class="lineNum">    1265</span>              :         }</span>
<span id="L1266"><span class="lineNum">    1266</span>              : </span>
<span id="L1267"><span class="lineNum">    1267</span>              :       if (__first == __middle)</span>
<span id="L1268"><span class="lineNum">    1268</span>              :         {</span>
<span id="L1269"><span class="lineNum">    1269</span>              :           std::__reverse(__middle, __last,   bidirectional_iterator_tag());</span>
<span id="L1270"><span class="lineNum">    1270</span>              :           return __last;</span>
<span id="L1271"><span class="lineNum">    1271</span>              :         }</span>
<span id="L1272"><span class="lineNum">    1272</span>              :       else</span>
<span id="L1273"><span class="lineNum">    1273</span>              :         {</span>
<span id="L1274"><span class="lineNum">    1274</span>              :           std::__reverse(__first,  __middle, bidirectional_iterator_tag());</span>
<span id="L1275"><span class="lineNum">    1275</span>              :           return __first;</span>
<span id="L1276"><span class="lineNum">    1276</span>              :         }</span>
<span id="L1277"><span class="lineNum">    1277</span>              :     }</span>
<span id="L1278"><span class="lineNum">    1278</span>              : </span>
<span id="L1279"><span class="lineNum">    1279</span>              :   /// This is a helper function for the rotate algorithm.</span>
<span id="L1280"><span class="lineNum">    1280</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L1281"><span class="lineNum">    1281</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1282"><span class="lineNum">    1282</span>              :     _RandomAccessIterator</span>
<span id="L1283"><span class="lineNum">    1283</span>              :     __rotate(_RandomAccessIterator __first,</span>
<span id="L1284"><span class="lineNum">    1284</span>              :              _RandomAccessIterator __middle,</span>
<span id="L1285"><span class="lineNum">    1285</span>              :              _RandomAccessIterator __last,</span>
<span id="L1286"><span class="lineNum">    1286</span>              :              random_access_iterator_tag)</span>
<span id="L1287"><span class="lineNum">    1287</span>              :     {</span>
<span id="L1288"><span class="lineNum">    1288</span>              :       // concept requirements</span>
<span id="L1289"><span class="lineNum">    1289</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L1290"><span class="lineNum">    1290</span>              :                                   _RandomAccessIterator&gt;)</span>
<span id="L1291"><span class="lineNum">    1291</span>              : </span>
<span id="L1292"><span class="lineNum">    1292</span>              :       if (__first == __middle)</span>
<span id="L1293"><span class="lineNum">    1293</span>              :         return __last;</span>
<span id="L1294"><span class="lineNum">    1294</span>              :       else if (__last == __middle)</span>
<span id="L1295"><span class="lineNum">    1295</span>              :         return __first;</span>
<span id="L1296"><span class="lineNum">    1296</span>              : </span>
<span id="L1297"><span class="lineNum">    1297</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::difference_type</span>
<span id="L1298"><span class="lineNum">    1298</span>              :         _Distance;</span>
<span id="L1299"><span class="lineNum">    1299</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L1300"><span class="lineNum">    1300</span>              :         _ValueType;</span>
<span id="L1301"><span class="lineNum">    1301</span>              : </span>
<span id="L1302"><span class="lineNum">    1302</span>              :       _Distance __n = __last   - __first;</span>
<span id="L1303"><span class="lineNum">    1303</span>              :       _Distance __k = __middle - __first;</span>
<span id="L1304"><span class="lineNum">    1304</span>              : </span>
<span id="L1305"><span class="lineNum">    1305</span>              :       if (__k == __n - __k)</span>
<span id="L1306"><span class="lineNum">    1306</span>              :         {</span>
<span id="L1307"><span class="lineNum">    1307</span>              :           std::swap_ranges(__first, __middle, __middle);</span>
<span id="L1308"><span class="lineNum">    1308</span>              :           return __middle;</span>
<span id="L1309"><span class="lineNum">    1309</span>              :         }</span>
<span id="L1310"><span class="lineNum">    1310</span>              : </span>
<span id="L1311"><span class="lineNum">    1311</span>              :       _RandomAccessIterator __p = __first;</span>
<span id="L1312"><span class="lineNum">    1312</span>              :       _RandomAccessIterator __ret = __first + (__last - __middle);</span>
<span id="L1313"><span class="lineNum">    1313</span>              : </span>
<span id="L1314"><span class="lineNum">    1314</span>              :       for (;;)</span>
<span id="L1315"><span class="lineNum">    1315</span>              :         {</span>
<span id="L1316"><span class="lineNum">    1316</span>              :           if (__k &lt; __n - __k)</span>
<span id="L1317"><span class="lineNum">    1317</span>              :             {</span>
<span id="L1318"><span class="lineNum">    1318</span>              :               if (__is_pod(_ValueType) &amp;&amp; __k == 1)</span>
<span id="L1319"><span class="lineNum">    1319</span>              :                 {</span>
<span id="L1320"><span class="lineNum">    1320</span>              :                   _ValueType __t = _GLIBCXX_MOVE(*__p);</span>
<span id="L1321"><span class="lineNum">    1321</span>              :                   _GLIBCXX_MOVE3(__p + 1, __p + __n, __p);</span>
<span id="L1322"><span class="lineNum">    1322</span>              :                   *(__p + __n - 1) = _GLIBCXX_MOVE(__t);</span>
<span id="L1323"><span class="lineNum">    1323</span>              :                   return __ret;</span>
<span id="L1324"><span class="lineNum">    1324</span>              :                 }</span>
<span id="L1325"><span class="lineNum">    1325</span>              :               _RandomAccessIterator __q = __p + __k;</span>
<span id="L1326"><span class="lineNum">    1326</span>              :               for (_Distance __i = 0; __i &lt; __n - __k; ++ __i)</span>
<span id="L1327"><span class="lineNum">    1327</span>              :                 {</span>
<span id="L1328"><span class="lineNum">    1328</span>              :                   std::iter_swap(__p, __q);</span>
<span id="L1329"><span class="lineNum">    1329</span>              :                   ++__p;</span>
<span id="L1330"><span class="lineNum">    1330</span>              :                   ++__q;</span>
<span id="L1331"><span class="lineNum">    1331</span>              :                 }</span>
<span id="L1332"><span class="lineNum">    1332</span>              :               __n %= __k;</span>
<span id="L1333"><span class="lineNum">    1333</span>              :               if (__n == 0)</span>
<span id="L1334"><span class="lineNum">    1334</span>              :                 return __ret;</span>
<span id="L1335"><span class="lineNum">    1335</span>              :               std::swap(__n, __k);</span>
<span id="L1336"><span class="lineNum">    1336</span>              :               __k = __n - __k;</span>
<span id="L1337"><span class="lineNum">    1337</span>              :             }</span>
<span id="L1338"><span class="lineNum">    1338</span>              :           else</span>
<span id="L1339"><span class="lineNum">    1339</span>              :             {</span>
<span id="L1340"><span class="lineNum">    1340</span>              :               __k = __n - __k;</span>
<span id="L1341"><span class="lineNum">    1341</span>              :               if (__is_pod(_ValueType) &amp;&amp; __k == 1)</span>
<span id="L1342"><span class="lineNum">    1342</span>              :                 {</span>
<span id="L1343"><span class="lineNum">    1343</span>              :                   _ValueType __t = _GLIBCXX_MOVE(*(__p + __n - 1));</span>
<span id="L1344"><span class="lineNum">    1344</span>              :                   _GLIBCXX_MOVE_BACKWARD3(__p, __p + __n - 1, __p + __n);</span>
<span id="L1345"><span class="lineNum">    1345</span>              :                   *__p = _GLIBCXX_MOVE(__t);</span>
<span id="L1346"><span class="lineNum">    1346</span>              :                   return __ret;</span>
<span id="L1347"><span class="lineNum">    1347</span>              :                 }</span>
<span id="L1348"><span class="lineNum">    1348</span>              :               _RandomAccessIterator __q = __p + __n;</span>
<span id="L1349"><span class="lineNum">    1349</span>              :               __p = __q - __k;</span>
<span id="L1350"><span class="lineNum">    1350</span>              :               for (_Distance __i = 0; __i &lt; __n - __k; ++ __i)</span>
<span id="L1351"><span class="lineNum">    1351</span>              :                 {</span>
<span id="L1352"><span class="lineNum">    1352</span>              :                   --__p;</span>
<span id="L1353"><span class="lineNum">    1353</span>              :                   --__q;</span>
<span id="L1354"><span class="lineNum">    1354</span>              :                   std::iter_swap(__p, __q);</span>
<span id="L1355"><span class="lineNum">    1355</span>              :                 }</span>
<span id="L1356"><span class="lineNum">    1356</span>              :               __n %= __k;</span>
<span id="L1357"><span class="lineNum">    1357</span>              :               if (__n == 0)</span>
<span id="L1358"><span class="lineNum">    1358</span>              :                 return __ret;</span>
<span id="L1359"><span class="lineNum">    1359</span>              :               std::swap(__n, __k);</span>
<span id="L1360"><span class="lineNum">    1360</span>              :             }</span>
<span id="L1361"><span class="lineNum">    1361</span>              :         }</span>
<span id="L1362"><span class="lineNum">    1362</span>              :     }</span>
<span id="L1363"><span class="lineNum">    1363</span>              : </span>
<span id="L1364"><span class="lineNum">    1364</span>              :    // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L1365"><span class="lineNum">    1365</span>              :    // DR 488. rotate throws away useful information</span>
<span id="L1366"><span class="lineNum">    1366</span>              :   /**</span>
<span id="L1367"><span class="lineNum">    1367</span>              :    *  @brief Rotate the elements of a sequence.</span>
<span id="L1368"><span class="lineNum">    1368</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L1369"><span class="lineNum">    1369</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L1370"><span class="lineNum">    1370</span>              :    *  @param  __middle  A forward iterator.</span>
<span id="L1371"><span class="lineNum">    1371</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L1372"><span class="lineNum">    1372</span>              :    *  @return  first + (last - middle).</span>
<span id="L1373"><span class="lineNum">    1373</span>              :    *</span>
<span id="L1374"><span class="lineNum">    1374</span>              :    *  Rotates the elements of the range @p [__first,__last) by </span>
<span id="L1375"><span class="lineNum">    1375</span>              :    *  @p (__middle - __first) positions so that the element at @p __middle</span>
<span id="L1376"><span class="lineNum">    1376</span>              :    *  is moved to @p __first, the element at @p __middle+1 is moved to</span>
<span id="L1377"><span class="lineNum">    1377</span>              :    *  @p __first+1 and so on for each element in the range</span>
<span id="L1378"><span class="lineNum">    1378</span>              :    *  @p [__first,__last).</span>
<span id="L1379"><span class="lineNum">    1379</span>              :    *</span>
<span id="L1380"><span class="lineNum">    1380</span>              :    *  This effectively swaps the ranges @p [__first,__middle) and</span>
<span id="L1381"><span class="lineNum">    1381</span>              :    *  @p [__middle,__last).</span>
<span id="L1382"><span class="lineNum">    1382</span>              :    *</span>
<span id="L1383"><span class="lineNum">    1383</span>              :    *  Performs</span>
<span id="L1384"><span class="lineNum">    1384</span>              :    *   @p *(__first+(n+(__last-__middle))%(__last-__first))=*(__first+n)</span>
<span id="L1385"><span class="lineNum">    1385</span>              :    *  for each @p n in the range @p [0,__last-__first).</span>
<span id="L1386"><span class="lineNum">    1386</span>              :   */</span>
<span id="L1387"><span class="lineNum">    1387</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L1388"><span class="lineNum">    1388</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1389"><span class="lineNum">    1389</span>              :     inline _ForwardIterator</span>
<span id="L1390"><span class="lineNum">    1390</span>              :     rotate(_ForwardIterator __first, _ForwardIterator __middle,</span>
<span id="L1391"><span class="lineNum">    1391</span>              :            _ForwardIterator __last)</span>
<span id="L1392"><span class="lineNum">    1392</span>              :     {</span>
<span id="L1393"><span class="lineNum">    1393</span>              :       // concept requirements</span>
<span id="L1394"><span class="lineNum">    1394</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L1395"><span class="lineNum">    1395</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L1396"><span class="lineNum">    1396</span>              :       __glibcxx_requires_valid_range(__first, __middle);</span>
<span id="L1397"><span class="lineNum">    1397</span>              :       __glibcxx_requires_valid_range(__middle, __last);</span>
<span id="L1398"><span class="lineNum">    1398</span>              : </span>
<span id="L1399"><span class="lineNum">    1399</span>              :       return std::__rotate(__first, __middle, __last,</span>
<span id="L1400"><span class="lineNum">    1400</span>              :                            std::__iterator_category(__first));</span>
<span id="L1401"><span class="lineNum">    1401</span>              :     }</span>
<span id="L1402"><span class="lineNum">    1402</span>              : </span>
<span id="L1403"><span class="lineNum">    1403</span>              : _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)</span>
<span id="L1404"><span class="lineNum">    1404</span>              : </span>
<span id="L1405"><span class="lineNum">    1405</span>              :   /**</span>
<span id="L1406"><span class="lineNum">    1406</span>              :    *  @brief Copy a sequence, rotating its elements.</span>
<span id="L1407"><span class="lineNum">    1407</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L1408"><span class="lineNum">    1408</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L1409"><span class="lineNum">    1409</span>              :    *  @param  __middle  A forward iterator.</span>
<span id="L1410"><span class="lineNum">    1410</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L1411"><span class="lineNum">    1411</span>              :    *  @param  __result  An output iterator.</span>
<span id="L1412"><span class="lineNum">    1412</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L1413"><span class="lineNum">    1413</span>              :    *</span>
<span id="L1414"><span class="lineNum">    1414</span>              :    *  Copies the elements of the range @p [__first,__last) to the</span>
<span id="L1415"><span class="lineNum">    1415</span>              :    *  range beginning at @result, rotating the copied elements by </span>
<span id="L1416"><span class="lineNum">    1416</span>              :    *  @p (__middle-__first) positions so that the element at @p __middle</span>
<span id="L1417"><span class="lineNum">    1417</span>              :    *  is moved to @p __result, the element at @p __middle+1 is moved</span>
<span id="L1418"><span class="lineNum">    1418</span>              :    *  to @p __result+1 and so on for each element in the range @p</span>
<span id="L1419"><span class="lineNum">    1419</span>              :    *  [__first,__last).</span>
<span id="L1420"><span class="lineNum">    1420</span>              :    *</span>
<span id="L1421"><span class="lineNum">    1421</span>              :    *  Performs </span>
<span id="L1422"><span class="lineNum">    1422</span>              :    *  @p *(__result+(n+(__last-__middle))%(__last-__first))=*(__first+n)</span>
<span id="L1423"><span class="lineNum">    1423</span>              :    *  for each @p n in the range @p [0,__last-__first).</span>
<span id="L1424"><span class="lineNum">    1424</span>              :   */</span>
<span id="L1425"><span class="lineNum">    1425</span>              :   template&lt;typename _ForwardIterator, typename _OutputIterator&gt;</span>
<span id="L1426"><span class="lineNum">    1426</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1427"><span class="lineNum">    1427</span>              :     inline _OutputIterator</span>
<span id="L1428"><span class="lineNum">    1428</span>              :     rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,</span>
<span id="L1429"><span class="lineNum">    1429</span>              :                 _ForwardIterator __last, _OutputIterator __result)</span>
<span id="L1430"><span class="lineNum">    1430</span>              :     {</span>
<span id="L1431"><span class="lineNum">    1431</span>              :       // concept requirements</span>
<span id="L1432"><span class="lineNum">    1432</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L1433"><span class="lineNum">    1433</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L1434"><span class="lineNum">    1434</span>              :                 typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L1435"><span class="lineNum">    1435</span>              :       __glibcxx_requires_valid_range(__first, __middle);</span>
<span id="L1436"><span class="lineNum">    1436</span>              :       __glibcxx_requires_valid_range(__middle, __last);</span>
<span id="L1437"><span class="lineNum">    1437</span>              : </span>
<span id="L1438"><span class="lineNum">    1438</span>              :       return std::copy(__first, __middle,</span>
<span id="L1439"><span class="lineNum">    1439</span>              :                        std::copy(__middle, __last, __result));</span>
<span id="L1440"><span class="lineNum">    1440</span>              :     }</span>
<span id="L1441"><span class="lineNum">    1441</span>              : </span>
<span id="L1442"><span class="lineNum">    1442</span>              :   /// This is a helper function...</span>
<span id="L1443"><span class="lineNum">    1443</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L1444"><span class="lineNum">    1444</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1445"><span class="lineNum">    1445</span>              :     _ForwardIterator</span>
<span id="L1446"><span class="lineNum">    1446</span>              :     __partition(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L1447"><span class="lineNum">    1447</span>              :                 _Predicate __pred, forward_iterator_tag)</span>
<span id="L1448"><span class="lineNum">    1448</span>              :     {</span>
<span id="L1449"><span class="lineNum">    1449</span>              :       if (__first == __last)</span>
<span id="L1450"><span class="lineNum">    1450</span>              :         return __first;</span>
<span id="L1451"><span class="lineNum">    1451</span>              : </span>
<span id="L1452"><span class="lineNum">    1452</span>              :       while (__pred(*__first))</span>
<span id="L1453"><span class="lineNum">    1453</span>              :         if (++__first == __last)</span>
<span id="L1454"><span class="lineNum">    1454</span>              :           return __first;</span>
<span id="L1455"><span class="lineNum">    1455</span>              : </span>
<span id="L1456"><span class="lineNum">    1456</span>              :       _ForwardIterator __next = __first;</span>
<span id="L1457"><span class="lineNum">    1457</span>              : </span>
<span id="L1458"><span class="lineNum">    1458</span>              :       while (++__next != __last)</span>
<span id="L1459"><span class="lineNum">    1459</span>              :         if (__pred(*__next))</span>
<span id="L1460"><span class="lineNum">    1460</span>              :           {</span>
<span id="L1461"><span class="lineNum">    1461</span>              :             std::iter_swap(__first, __next);</span>
<span id="L1462"><span class="lineNum">    1462</span>              :             ++__first;</span>
<span id="L1463"><span class="lineNum">    1463</span>              :           }</span>
<span id="L1464"><span class="lineNum">    1464</span>              : </span>
<span id="L1465"><span class="lineNum">    1465</span>              :       return __first;</span>
<span id="L1466"><span class="lineNum">    1466</span>              :     }</span>
<span id="L1467"><span class="lineNum">    1467</span>              : </span>
<span id="L1468"><span class="lineNum">    1468</span>              :   /// This is a helper function...</span>
<span id="L1469"><span class="lineNum">    1469</span>              :   template&lt;typename _BidirectionalIterator, typename _Predicate&gt;</span>
<span id="L1470"><span class="lineNum">    1470</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1471"><span class="lineNum">    1471</span>              :     _BidirectionalIterator</span>
<span id="L1472"><span class="lineNum">    1472</span>              :     __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,</span>
<span id="L1473"><span class="lineNum">    1473</span>              :                 _Predicate __pred, bidirectional_iterator_tag)</span>
<span id="L1474"><span class="lineNum">    1474</span>              :     {</span>
<span id="L1475"><span class="lineNum">    1475</span>              :       while (true)</span>
<span id="L1476"><span class="lineNum">    1476</span>              :         {</span>
<span id="L1477"><span class="lineNum">    1477</span>              :           while (true)</span>
<span id="L1478"><span class="lineNum">    1478</span>              :             if (__first == __last)</span>
<span id="L1479"><span class="lineNum">    1479</span>              :               return __first;</span>
<span id="L1480"><span class="lineNum">    1480</span>              :             else if (__pred(*__first))</span>
<span id="L1481"><span class="lineNum">    1481</span>              :               ++__first;</span>
<span id="L1482"><span class="lineNum">    1482</span>              :             else</span>
<span id="L1483"><span class="lineNum">    1483</span>              :               break;</span>
<span id="L1484"><span class="lineNum">    1484</span>              :           --__last;</span>
<span id="L1485"><span class="lineNum">    1485</span>              :           while (true)</span>
<span id="L1486"><span class="lineNum">    1486</span>              :             if (__first == __last)</span>
<span id="L1487"><span class="lineNum">    1487</span>              :               return __first;</span>
<span id="L1488"><span class="lineNum">    1488</span>              :             else if (!bool(__pred(*__last)))</span>
<span id="L1489"><span class="lineNum">    1489</span>              :               --__last;</span>
<span id="L1490"><span class="lineNum">    1490</span>              :             else</span>
<span id="L1491"><span class="lineNum">    1491</span>              :               break;</span>
<span id="L1492"><span class="lineNum">    1492</span>              :           std::iter_swap(__first, __last);</span>
<span id="L1493"><span class="lineNum">    1493</span>              :           ++__first;</span>
<span id="L1494"><span class="lineNum">    1494</span>              :         }</span>
<span id="L1495"><span class="lineNum">    1495</span>              :     }</span>
<span id="L1496"><span class="lineNum">    1496</span>              : </span>
<span id="L1497"><span class="lineNum">    1497</span>              : #if _GLIBCXX_HOSTED</span>
<span id="L1498"><span class="lineNum">    1498</span>              :   // partition</span>
<span id="L1499"><span class="lineNum">    1499</span>              : </span>
<span id="L1500"><span class="lineNum">    1500</span>              :   /// This is a helper function...</span>
<span id="L1501"><span class="lineNum">    1501</span>              :   /// Requires __first != __last and !__pred(__first)</span>
<span id="L1502"><span class="lineNum">    1502</span>              :   /// and __len == distance(__first, __last).</span>
<span id="L1503"><span class="lineNum">    1503</span>              :   ///</span>
<span id="L1504"><span class="lineNum">    1504</span>              :   /// !__pred(__first) allows us to guarantee that we don't</span>
<span id="L1505"><span class="lineNum">    1505</span>              :   /// move-assign an element onto itself.</span>
<span id="L1506"><span class="lineNum">    1506</span>              :   template&lt;typename _ForwardIterator, typename _Pointer, typename _Predicate,</span>
<span id="L1507"><span class="lineNum">    1507</span>              :            typename _Distance&gt;</span>
<span id="L1508"><span class="lineNum">    1508</span>              :     _ForwardIterator</span>
<span id="L1509"><span class="lineNum">    1509</span>              :     __stable_partition_adaptive(_ForwardIterator __first,</span>
<span id="L1510"><span class="lineNum">    1510</span>              :                                 _ForwardIterator __last,</span>
<span id="L1511"><span class="lineNum">    1511</span>              :                                 _Predicate __pred, _Distance __len,</span>
<span id="L1512"><span class="lineNum">    1512</span>              :                                 _Pointer __buffer,</span>
<span id="L1513"><span class="lineNum">    1513</span>              :                                 _Distance __buffer_size)</span>
<span id="L1514"><span class="lineNum">    1514</span>              :     {</span>
<span id="L1515"><span class="lineNum">    1515</span>              :       if (__len == 1)</span>
<span id="L1516"><span class="lineNum">    1516</span>              :         return __first;</span>
<span id="L1517"><span class="lineNum">    1517</span>              : </span>
<span id="L1518"><span class="lineNum">    1518</span>              :       if (__len &lt;= __buffer_size)</span>
<span id="L1519"><span class="lineNum">    1519</span>              :         {</span>
<span id="L1520"><span class="lineNum">    1520</span>              :           _ForwardIterator __result1 = __first;</span>
<span id="L1521"><span class="lineNum">    1521</span>              :           _Pointer __result2 = __buffer;</span>
<span id="L1522"><span class="lineNum">    1522</span>              : </span>
<span id="L1523"><span class="lineNum">    1523</span>              :           // The precondition guarantees that !__pred(__first), so</span>
<span id="L1524"><span class="lineNum">    1524</span>              :           // move that element to the buffer before starting the loop.</span>
<span id="L1525"><span class="lineNum">    1525</span>              :           // This ensures that we only call __pred once per element.</span>
<span id="L1526"><span class="lineNum">    1526</span>              :           *__result2 = _GLIBCXX_MOVE(*__first);</span>
<span id="L1527"><span class="lineNum">    1527</span>              :           ++__result2;</span>
<span id="L1528"><span class="lineNum">    1528</span>              :           ++__first;</span>
<span id="L1529"><span class="lineNum">    1529</span>              :           for (; __first != __last; ++__first)</span>
<span id="L1530"><span class="lineNum">    1530</span>              :             if (__pred(__first))</span>
<span id="L1531"><span class="lineNum">    1531</span>              :               {</span>
<span id="L1532"><span class="lineNum">    1532</span>              :                 *__result1 = _GLIBCXX_MOVE(*__first);</span>
<span id="L1533"><span class="lineNum">    1533</span>              :                 ++__result1;</span>
<span id="L1534"><span class="lineNum">    1534</span>              :               }</span>
<span id="L1535"><span class="lineNum">    1535</span>              :             else</span>
<span id="L1536"><span class="lineNum">    1536</span>              :               {</span>
<span id="L1537"><span class="lineNum">    1537</span>              :                 *__result2 = _GLIBCXX_MOVE(*__first);</span>
<span id="L1538"><span class="lineNum">    1538</span>              :                 ++__result2;</span>
<span id="L1539"><span class="lineNum">    1539</span>              :               }</span>
<span id="L1540"><span class="lineNum">    1540</span>              : </span>
<span id="L1541"><span class="lineNum">    1541</span>              :           _GLIBCXX_MOVE3(__buffer, __result2, __result1);</span>
<span id="L1542"><span class="lineNum">    1542</span>              :           return __result1;</span>
<span id="L1543"><span class="lineNum">    1543</span>              :         }</span>
<span id="L1544"><span class="lineNum">    1544</span>              : </span>
<span id="L1545"><span class="lineNum">    1545</span>              :       _ForwardIterator __middle = __first;</span>
<span id="L1546"><span class="lineNum">    1546</span>              :       std::advance(__middle, __len / 2);</span>
<span id="L1547"><span class="lineNum">    1547</span>              :       _ForwardIterator __left_split =</span>
<span id="L1548"><span class="lineNum">    1548</span>              :         std::__stable_partition_adaptive(__first, __middle, __pred,</span>
<span id="L1549"><span class="lineNum">    1549</span>              :                                          __len / 2, __buffer,</span>
<span id="L1550"><span class="lineNum">    1550</span>              :                                          __buffer_size);</span>
<span id="L1551"><span class="lineNum">    1551</span>              : </span>
<span id="L1552"><span class="lineNum">    1552</span>              :       // Advance past true-predicate values to satisfy this</span>
<span id="L1553"><span class="lineNum">    1553</span>              :       // function's preconditions.</span>
<span id="L1554"><span class="lineNum">    1554</span>              :       _Distance __right_len = __len - __len / 2;</span>
<span id="L1555"><span class="lineNum">    1555</span>              :       _ForwardIterator __right_split =</span>
<span id="L1556"><span class="lineNum">    1556</span>              :         std::__find_if_not_n(__middle, __right_len, __pred);</span>
<span id="L1557"><span class="lineNum">    1557</span>              : </span>
<span id="L1558"><span class="lineNum">    1558</span>              :       if (__right_len)</span>
<span id="L1559"><span class="lineNum">    1559</span>              :         __right_split =</span>
<span id="L1560"><span class="lineNum">    1560</span>              :           std::__stable_partition_adaptive(__right_split, __last, __pred,</span>
<span id="L1561"><span class="lineNum">    1561</span>              :                                            __right_len,</span>
<span id="L1562"><span class="lineNum">    1562</span>              :                                            __buffer, __buffer_size);</span>
<span id="L1563"><span class="lineNum">    1563</span>              : </span>
<span id="L1564"><span class="lineNum">    1564</span>              :       return std::rotate(__left_split, __middle, __right_split);</span>
<span id="L1565"><span class="lineNum">    1565</span>              :     }</span>
<span id="L1566"><span class="lineNum">    1566</span>              : </span>
<span id="L1567"><span class="lineNum">    1567</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L1568"><span class="lineNum">    1568</span>              :     _ForwardIterator</span>
<span id="L1569"><span class="lineNum">    1569</span>              :     __stable_partition(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L1570"><span class="lineNum">    1570</span>              :                        _Predicate __pred)</span>
<span id="L1571"><span class="lineNum">    1571</span>              :     {</span>
<span id="L1572"><span class="lineNum">    1572</span>              :       __first = std::__find_if_not(__first, __last, __pred);</span>
<span id="L1573"><span class="lineNum">    1573</span>              : </span>
<span id="L1574"><span class="lineNum">    1574</span>              :       if (__first == __last)</span>
<span id="L1575"><span class="lineNum">    1575</span>              :         return __first;</span>
<span id="L1576"><span class="lineNum">    1576</span>              : </span>
<span id="L1577"><span class="lineNum">    1577</span>              :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::value_type</span>
<span id="L1578"><span class="lineNum">    1578</span>              :         _ValueType;</span>
<span id="L1579"><span class="lineNum">    1579</span>              :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::difference_type</span>
<span id="L1580"><span class="lineNum">    1580</span>              :         _DistanceType;</span>
<span id="L1581"><span class="lineNum">    1581</span>              : </span>
<span id="L1582"><span class="lineNum">    1582</span>              :       _Temporary_buffer&lt;_ForwardIterator, _ValueType&gt;</span>
<span id="L1583"><span class="lineNum">    1583</span>              :         __buf(__first, std::distance(__first, __last));</span>
<span id="L1584"><span class="lineNum">    1584</span>              :       return</span>
<span id="L1585"><span class="lineNum">    1585</span>              :         std::__stable_partition_adaptive(__first, __last, __pred,</span>
<span id="L1586"><span class="lineNum">    1586</span>              :                                          _DistanceType(__buf.requested_size()),</span>
<span id="L1587"><span class="lineNum">    1587</span>              :                                          __buf.begin(),</span>
<span id="L1588"><span class="lineNum">    1588</span>              :                                          _DistanceType(__buf.size()));</span>
<span id="L1589"><span class="lineNum">    1589</span>              :     }</span>
<span id="L1590"><span class="lineNum">    1590</span>              : </span>
<span id="L1591"><span class="lineNum">    1591</span>              :   /**</span>
<span id="L1592"><span class="lineNum">    1592</span>              :    *  @brief Move elements for which a predicate is true to the beginning</span>
<span id="L1593"><span class="lineNum">    1593</span>              :    *         of a sequence, preserving relative ordering.</span>
<span id="L1594"><span class="lineNum">    1594</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L1595"><span class="lineNum">    1595</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L1596"><span class="lineNum">    1596</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L1597"><span class="lineNum">    1597</span>              :    *  @param  __pred    A predicate functor.</span>
<span id="L1598"><span class="lineNum">    1598</span>              :    *  @return  An iterator @p middle such that @p __pred(i) is true for each</span>
<span id="L1599"><span class="lineNum">    1599</span>              :    *  iterator @p i in the range @p [first,middle) and false for each @p i</span>
<span id="L1600"><span class="lineNum">    1600</span>              :    *  in the range @p [middle,last).</span>
<span id="L1601"><span class="lineNum">    1601</span>              :    *</span>
<span id="L1602"><span class="lineNum">    1602</span>              :    *  Performs the same function as @p partition() with the additional</span>
<span id="L1603"><span class="lineNum">    1603</span>              :    *  guarantee that the relative ordering of elements in each group is</span>
<span id="L1604"><span class="lineNum">    1604</span>              :    *  preserved, so any two elements @p x and @p y in the range</span>
<span id="L1605"><span class="lineNum">    1605</span>              :    *  @p [__first,__last) such that @p __pred(x)==__pred(y) will have the same</span>
<span id="L1606"><span class="lineNum">    1606</span>              :    *  relative ordering after calling @p stable_partition().</span>
<span id="L1607"><span class="lineNum">    1607</span>              :   */</span>
<span id="L1608"><span class="lineNum">    1608</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L1609"><span class="lineNum">    1609</span>              :     inline _ForwardIterator</span>
<span id="L1610"><span class="lineNum">    1610</span>              :     stable_partition(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L1611"><span class="lineNum">    1611</span>              :                      _Predicate __pred)</span>
<span id="L1612"><span class="lineNum">    1612</span>              :     {</span>
<span id="L1613"><span class="lineNum">    1613</span>              :       // concept requirements</span>
<span id="L1614"><span class="lineNum">    1614</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L1615"><span class="lineNum">    1615</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L1616"><span class="lineNum">    1616</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L1617"><span class="lineNum">    1617</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L1618"><span class="lineNum">    1618</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L1619"><span class="lineNum">    1619</span>              : </span>
<span id="L1620"><span class="lineNum">    1620</span>              :       return std::__stable_partition(__first, __last,</span>
<span id="L1621"><span class="lineNum">    1621</span>              :                                      __gnu_cxx::__ops::__pred_iter(__pred));</span>
<span id="L1622"><span class="lineNum">    1622</span>              :     }</span>
<span id="L1623"><span class="lineNum">    1623</span>              : #endif // HOSTED</span>
<span id="L1624"><span class="lineNum">    1624</span>              : </span>
<span id="L1625"><span class="lineNum">    1625</span>              :   /// @cond undocumented</span>
<span id="L1626"><span class="lineNum">    1626</span>              : </span>
<span id="L1627"><span class="lineNum">    1627</span>              :   /// This is a helper function for the sort routines.</span>
<span id="L1628"><span class="lineNum">    1628</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1629"><span class="lineNum">    1629</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1630"><span class="lineNum">    1630</span>              :     void</span>
<span id="L1631"><span class="lineNum">    1631</span>              :     __heap_select(_RandomAccessIterator __first,</span>
<span id="L1632"><span class="lineNum">    1632</span>              :                   _RandomAccessIterator __middle,</span>
<span id="L1633"><span class="lineNum">    1633</span>              :                   _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L1634"><span class="lineNum">    1634</span>              :     {</span>
<span id="L1635"><span class="lineNum">    1635</span>              :       std::__make_heap(__first, __middle, __comp);</span>
<span id="L1636"><span class="lineNum">    1636</span>              :       for (_RandomAccessIterator __i = __middle; __i &lt; __last; ++__i)</span>
<span id="L1637"><span class="lineNum">    1637</span>              :         if (__comp(__i, __first))</span>
<span id="L1638"><span class="lineNum">    1638</span>              :           std::__pop_heap(__first, __middle, __i, __comp);</span>
<span id="L1639"><span class="lineNum">    1639</span>              :     }</span>
<span id="L1640"><span class="lineNum">    1640</span>              : </span>
<span id="L1641"><span class="lineNum">    1641</span>              :   // partial_sort</span>
<span id="L1642"><span class="lineNum">    1642</span>              : </span>
<span id="L1643"><span class="lineNum">    1643</span>              :   template&lt;typename _InputIterator, typename _RandomAccessIterator,</span>
<span id="L1644"><span class="lineNum">    1644</span>              :            typename _Compare&gt;</span>
<span id="L1645"><span class="lineNum">    1645</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1646"><span class="lineNum">    1646</span>              :     _RandomAccessIterator</span>
<span id="L1647"><span class="lineNum">    1647</span>              :     __partial_sort_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L1648"><span class="lineNum">    1648</span>              :                         _RandomAccessIterator __result_first,</span>
<span id="L1649"><span class="lineNum">    1649</span>              :                         _RandomAccessIterator __result_last,</span>
<span id="L1650"><span class="lineNum">    1650</span>              :                         _Compare __comp)</span>
<span id="L1651"><span class="lineNum">    1651</span>              :     {</span>
<span id="L1652"><span class="lineNum">    1652</span>              :       typedef typename iterator_traits&lt;_InputIterator&gt;::value_type</span>
<span id="L1653"><span class="lineNum">    1653</span>              :         _InputValueType;</span>
<span id="L1654"><span class="lineNum">    1654</span>              :       typedef iterator_traits&lt;_RandomAccessIterator&gt; _RItTraits;</span>
<span id="L1655"><span class="lineNum">    1655</span>              :       typedef typename _RItTraits::difference_type _DistanceType;</span>
<span id="L1656"><span class="lineNum">    1656</span>              : </span>
<span id="L1657"><span class="lineNum">    1657</span>              :       if (__result_first == __result_last)</span>
<span id="L1658"><span class="lineNum">    1658</span>              :         return __result_last;</span>
<span id="L1659"><span class="lineNum">    1659</span>              :       _RandomAccessIterator __result_real_last = __result_first;</span>
<span id="L1660"><span class="lineNum">    1660</span>              :       while (__first != __last &amp;&amp; __result_real_last != __result_last)</span>
<span id="L1661"><span class="lineNum">    1661</span>              :         {</span>
<span id="L1662"><span class="lineNum">    1662</span>              :           *__result_real_last = *__first;</span>
<span id="L1663"><span class="lineNum">    1663</span>              :           ++__result_real_last;</span>
<span id="L1664"><span class="lineNum">    1664</span>              :           ++__first;</span>
<span id="L1665"><span class="lineNum">    1665</span>              :         }</span>
<span id="L1666"><span class="lineNum">    1666</span>              :       </span>
<span id="L1667"><span class="lineNum">    1667</span>              :       std::__make_heap(__result_first, __result_real_last, __comp);</span>
<span id="L1668"><span class="lineNum">    1668</span>              :       while (__first != __last)</span>
<span id="L1669"><span class="lineNum">    1669</span>              :         {</span>
<span id="L1670"><span class="lineNum">    1670</span>              :           if (__comp(__first, __result_first))</span>
<span id="L1671"><span class="lineNum">    1671</span>              :             std::__adjust_heap(__result_first, _DistanceType(0),</span>
<span id="L1672"><span class="lineNum">    1672</span>              :                                _DistanceType(__result_real_last</span>
<span id="L1673"><span class="lineNum">    1673</span>              :                                              - __result_first),</span>
<span id="L1674"><span class="lineNum">    1674</span>              :                                _InputValueType(*__first), __comp);</span>
<span id="L1675"><span class="lineNum">    1675</span>              :           ++__first;</span>
<span id="L1676"><span class="lineNum">    1676</span>              :         }</span>
<span id="L1677"><span class="lineNum">    1677</span>              :       std::__sort_heap(__result_first, __result_real_last, __comp);</span>
<span id="L1678"><span class="lineNum">    1678</span>              :       return __result_real_last;</span>
<span id="L1679"><span class="lineNum">    1679</span>              :     }</span>
<span id="L1680"><span class="lineNum">    1680</span>              : </span>
<span id="L1681"><span class="lineNum">    1681</span>              :   /// @endcond</span>
<span id="L1682"><span class="lineNum">    1682</span>              : </span>
<span id="L1683"><span class="lineNum">    1683</span>              :   /**</span>
<span id="L1684"><span class="lineNum">    1684</span>              :    *  @brief Copy the smallest elements of a sequence.</span>
<span id="L1685"><span class="lineNum">    1685</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L1686"><span class="lineNum">    1686</span>              :    *  @param  __first   An iterator.</span>
<span id="L1687"><span class="lineNum">    1687</span>              :    *  @param  __last    Another iterator.</span>
<span id="L1688"><span class="lineNum">    1688</span>              :    *  @param  __result_first   A random-access iterator.</span>
<span id="L1689"><span class="lineNum">    1689</span>              :    *  @param  __result_last    Another random-access iterator.</span>
<span id="L1690"><span class="lineNum">    1690</span>              :    *  @return   An iterator indicating the end of the resulting sequence.</span>
<span id="L1691"><span class="lineNum">    1691</span>              :    *</span>
<span id="L1692"><span class="lineNum">    1692</span>              :    *  Copies and sorts the smallest `N` values from the range</span>
<span id="L1693"><span class="lineNum">    1693</span>              :    *  `[__first, __last)` to the range beginning at `__result_first`, where</span>
<span id="L1694"><span class="lineNum">    1694</span>              :    *  the number of elements to be copied, `N`, is the smaller of</span>
<span id="L1695"><span class="lineNum">    1695</span>              :    *  `(__last - __first)` and `(__result_last - __result_first)`.</span>
<span id="L1696"><span class="lineNum">    1696</span>              :    *  After the sort if `i` and `j` are iterators in the range</span>
<span id="L1697"><span class="lineNum">    1697</span>              :    *  `[__result_first,__result_first + N)` such that `i` precedes `j` then</span>
<span id="L1698"><span class="lineNum">    1698</span>              :    *  `*j &lt; *i` is false.</span>
<span id="L1699"><span class="lineNum">    1699</span>              :    *  The value returned is `__result_first + N`.</span>
<span id="L1700"><span class="lineNum">    1700</span>              :   */</span>
<span id="L1701"><span class="lineNum">    1701</span>              :   template&lt;typename _InputIterator, typename _RandomAccessIterator&gt;</span>
<span id="L1702"><span class="lineNum">    1702</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1703"><span class="lineNum">    1703</span>              :     inline _RandomAccessIterator</span>
<span id="L1704"><span class="lineNum">    1704</span>              :     partial_sort_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L1705"><span class="lineNum">    1705</span>              :                       _RandomAccessIterator __result_first,</span>
<span id="L1706"><span class="lineNum">    1706</span>              :                       _RandomAccessIterator __result_last)</span>
<span id="L1707"><span class="lineNum">    1707</span>              :     {</span>
<span id="L1708"><span class="lineNum">    1708</span>              : #ifdef _GLIBCXX_CONCEPT_CHECKS</span>
<span id="L1709"><span class="lineNum">    1709</span>              :       typedef typename iterator_traits&lt;_InputIterator&gt;::value_type</span>
<span id="L1710"><span class="lineNum">    1710</span>              :         _InputValueType;</span>
<span id="L1711"><span class="lineNum">    1711</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L1712"><span class="lineNum">    1712</span>              :         _OutputValueType;</span>
<span id="L1713"><span class="lineNum">    1713</span>              : #endif</span>
<span id="L1714"><span class="lineNum">    1714</span>              : </span>
<span id="L1715"><span class="lineNum">    1715</span>              :       // concept requirements</span>
<span id="L1716"><span class="lineNum">    1716</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L1717"><span class="lineNum">    1717</span>              :       __glibcxx_function_requires(_ConvertibleConcept&lt;_InputValueType,</span>
<span id="L1718"><span class="lineNum">    1718</span>              :                                   _OutputValueType&gt;)</span>
<span id="L1719"><span class="lineNum">    1719</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;_InputValueType,</span>
<span id="L1720"><span class="lineNum">    1720</span>              :                                                      _OutputValueType&gt;)</span>
<span id="L1721"><span class="lineNum">    1721</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;_OutputValueType&gt;)</span>
<span id="L1722"><span class="lineNum">    1722</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L1723"><span class="lineNum">    1723</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L1724"><span class="lineNum">    1724</span>              :       __glibcxx_requires_valid_range(__result_first, __result_last);</span>
<span id="L1725"><span class="lineNum">    1725</span>              : </span>
<span id="L1726"><span class="lineNum">    1726</span>              :       return std::__partial_sort_copy(__first, __last,</span>
<span id="L1727"><span class="lineNum">    1727</span>              :                                       __result_first, __result_last,</span>
<span id="L1728"><span class="lineNum">    1728</span>              :                                       __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L1729"><span class="lineNum">    1729</span>              :     }</span>
<span id="L1730"><span class="lineNum">    1730</span>              : </span>
<span id="L1731"><span class="lineNum">    1731</span>              :   /**</span>
<span id="L1732"><span class="lineNum">    1732</span>              :    *  @brief Copy the smallest elements of a sequence using a predicate for</span>
<span id="L1733"><span class="lineNum">    1733</span>              :    *         comparison.</span>
<span id="L1734"><span class="lineNum">    1734</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L1735"><span class="lineNum">    1735</span>              :    *  @param  __first   An input iterator.</span>
<span id="L1736"><span class="lineNum">    1736</span>              :    *  @param  __last    Another input iterator.</span>
<span id="L1737"><span class="lineNum">    1737</span>              :    *  @param  __result_first   A random-access iterator.</span>
<span id="L1738"><span class="lineNum">    1738</span>              :    *  @param  __result_last    Another random-access iterator.</span>
<span id="L1739"><span class="lineNum">    1739</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L1740"><span class="lineNum">    1740</span>              :    *  @return   An iterator indicating the end of the resulting sequence.</span>
<span id="L1741"><span class="lineNum">    1741</span>              :    *</span>
<span id="L1742"><span class="lineNum">    1742</span>              :    *  Copies and sorts the smallest `N` values from the range</span>
<span id="L1743"><span class="lineNum">    1743</span>              :    *  `[__first, __last)` to the range beginning at `result_first`, where</span>
<span id="L1744"><span class="lineNum">    1744</span>              :    *  the number of elements to be copied, `N`, is the smaller of</span>
<span id="L1745"><span class="lineNum">    1745</span>              :    *  `(__last - __first)` and `(__result_last - __result_first)`.</span>
<span id="L1746"><span class="lineNum">    1746</span>              :    *  After the sort if `i` and `j` are iterators in the range</span>
<span id="L1747"><span class="lineNum">    1747</span>              :    *  `[__result_first, __result_first + N)` such that `i` precedes `j` then</span>
<span id="L1748"><span class="lineNum">    1748</span>              :    *  `__comp(*j, *i)` is false.</span>
<span id="L1749"><span class="lineNum">    1749</span>              :    *  The value returned is `__result_first + N`.</span>
<span id="L1750"><span class="lineNum">    1750</span>              :   */</span>
<span id="L1751"><span class="lineNum">    1751</span>              :   template&lt;typename _InputIterator, typename _RandomAccessIterator,</span>
<span id="L1752"><span class="lineNum">    1752</span>              :            typename _Compare&gt;</span>
<span id="L1753"><span class="lineNum">    1753</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1754"><span class="lineNum">    1754</span>              :     inline _RandomAccessIterator</span>
<span id="L1755"><span class="lineNum">    1755</span>              :     partial_sort_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L1756"><span class="lineNum">    1756</span>              :                       _RandomAccessIterator __result_first,</span>
<span id="L1757"><span class="lineNum">    1757</span>              :                       _RandomAccessIterator __result_last,</span>
<span id="L1758"><span class="lineNum">    1758</span>              :                       _Compare __comp)</span>
<span id="L1759"><span class="lineNum">    1759</span>              :     {</span>
<span id="L1760"><span class="lineNum">    1760</span>              : #ifdef _GLIBCXX_CONCEPT_CHECKS</span>
<span id="L1761"><span class="lineNum">    1761</span>              :       typedef typename iterator_traits&lt;_InputIterator&gt;::value_type</span>
<span id="L1762"><span class="lineNum">    1762</span>              :         _InputValueType;</span>
<span id="L1763"><span class="lineNum">    1763</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L1764"><span class="lineNum">    1764</span>              :         _OutputValueType;</span>
<span id="L1765"><span class="lineNum">    1765</span>              : #endif</span>
<span id="L1766"><span class="lineNum">    1766</span>              : </span>
<span id="L1767"><span class="lineNum">    1767</span>              :       // concept requirements</span>
<span id="L1768"><span class="lineNum">    1768</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L1769"><span class="lineNum">    1769</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L1770"><span class="lineNum">    1770</span>              :                                   _RandomAccessIterator&gt;)</span>
<span id="L1771"><span class="lineNum">    1771</span>              :       __glibcxx_function_requires(_ConvertibleConcept&lt;_InputValueType,</span>
<span id="L1772"><span class="lineNum">    1772</span>              :                                   _OutputValueType&gt;)</span>
<span id="L1773"><span class="lineNum">    1773</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L1774"><span class="lineNum">    1774</span>              :                                   _InputValueType, _OutputValueType&gt;)</span>
<span id="L1775"><span class="lineNum">    1775</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L1776"><span class="lineNum">    1776</span>              :                                   _OutputValueType, _OutputValueType&gt;)</span>
<span id="L1777"><span class="lineNum">    1777</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L1778"><span class="lineNum">    1778</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L1779"><span class="lineNum">    1779</span>              :       __glibcxx_requires_valid_range(__result_first, __result_last);</span>
<span id="L1780"><span class="lineNum">    1780</span>              : </span>
<span id="L1781"><span class="lineNum">    1781</span>              :       return std::__partial_sort_copy(__first, __last,</span>
<span id="L1782"><span class="lineNum">    1782</span>              :                                       __result_first, __result_last,</span>
<span id="L1783"><span class="lineNum">    1783</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L1784"><span class="lineNum">    1784</span>              :     }</span>
<span id="L1785"><span class="lineNum">    1785</span>              : </span>
<span id="L1786"><span class="lineNum">    1786</span>              :   /// @cond undocumented</span>
<span id="L1787"><span class="lineNum">    1787</span>              : </span>
<span id="L1788"><span class="lineNum">    1788</span>              :   /// This is a helper function for the sort routine.</span>
<span id="L1789"><span class="lineNum">    1789</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1790"><span class="lineNum">    1790</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1791"><span class="lineNum">    1791</span>              :     void</span>
<span id="L1792"><span class="lineNum">    1792</span>              :     __unguarded_linear_insert(_RandomAccessIterator __last,</span>
<span id="L1793"><span class="lineNum">    1793</span>              :                               _Compare __comp)</span>
<span id="L1794"><span class="lineNum">    1794</span>              :     {</span>
<span id="L1795"><span class="lineNum">    1795</span>              :       typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L1796"><span class="lineNum">    1796</span>              :         __val = _GLIBCXX_MOVE(*__last);</span>
<span id="L1797"><span class="lineNum">    1797</span>              :       _RandomAccessIterator __next = __last;</span>
<span id="L1798"><span class="lineNum">    1798</span>              :       --__next;</span>
<span id="L1799"><span class="lineNum">    1799</span>              :       while (__comp(__val, __next))</span>
<span id="L1800"><span class="lineNum">    1800</span>              :         {</span>
<span id="L1801"><span class="lineNum">    1801</span>              :           *__last = _GLIBCXX_MOVE(*__next);</span>
<span id="L1802"><span class="lineNum">    1802</span>              :           __last = __next;</span>
<span id="L1803"><span class="lineNum">    1803</span>              :           --__next;</span>
<span id="L1804"><span class="lineNum">    1804</span>              :         }</span>
<span id="L1805"><span class="lineNum">    1805</span>              :       *__last = _GLIBCXX_MOVE(__val);</span>
<span id="L1806"><span class="lineNum">    1806</span>              :     }</span>
<span id="L1807"><span class="lineNum">    1807</span>              : </span>
<span id="L1808"><span class="lineNum">    1808</span>              :   /// This is a helper function for the sort routine.</span>
<span id="L1809"><span class="lineNum">    1809</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1810"><span class="lineNum">    1810</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1811"><span class="lineNum">    1811</span>              :     void</span>
<span id="L1812"><span class="lineNum">    1812</span>              :     __insertion_sort(_RandomAccessIterator __first,</span>
<span id="L1813"><span class="lineNum">    1813</span>              :                      _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L1814"><span class="lineNum">    1814</span>              :     {</span>
<span id="L1815"><span class="lineNum">    1815</span>              :       if (__first == __last) return;</span>
<span id="L1816"><span class="lineNum">    1816</span>              : </span>
<span id="L1817"><span class="lineNum">    1817</span>              :       for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)</span>
<span id="L1818"><span class="lineNum">    1818</span>              :         {</span>
<span id="L1819"><span class="lineNum">    1819</span>              :           if (__comp(__i, __first))</span>
<span id="L1820"><span class="lineNum">    1820</span>              :             {</span>
<span id="L1821"><span class="lineNum">    1821</span>              :               typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L1822"><span class="lineNum">    1822</span>              :                 __val = _GLIBCXX_MOVE(*__i);</span>
<span id="L1823"><span class="lineNum">    1823</span>              :               _GLIBCXX_MOVE_BACKWARD3(__first, __i, __i + 1);</span>
<span id="L1824"><span class="lineNum">    1824</span>              :               *__first = _GLIBCXX_MOVE(__val);</span>
<span id="L1825"><span class="lineNum">    1825</span>              :             }</span>
<span id="L1826"><span class="lineNum">    1826</span>              :           else</span>
<span id="L1827"><span class="lineNum">    1827</span>              :             std::__unguarded_linear_insert(__i,</span>
<span id="L1828"><span class="lineNum">    1828</span>              :                                 __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L1829"><span class="lineNum">    1829</span>              :         }</span>
<span id="L1830"><span class="lineNum">    1830</span>              :     }</span>
<span id="L1831"><span class="lineNum">    1831</span>              : </span>
<span id="L1832"><span class="lineNum">    1832</span>              :   /// This is a helper function for the sort routine.</span>
<span id="L1833"><span class="lineNum">    1833</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1834"><span class="lineNum">    1834</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1835"><span class="lineNum">    1835</span>              :     inline void</span>
<span id="L1836"><span class="lineNum">    1836</span>              :     __unguarded_insertion_sort(_RandomAccessIterator __first,</span>
<span id="L1837"><span class="lineNum">    1837</span>              :                                _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L1838"><span class="lineNum">    1838</span>              :     {</span>
<span id="L1839"><span class="lineNum">    1839</span>              :       for (_RandomAccessIterator __i = __first; __i != __last; ++__i)</span>
<span id="L1840"><span class="lineNum">    1840</span>              :         std::__unguarded_linear_insert(__i,</span>
<span id="L1841"><span class="lineNum">    1841</span>              :                                 __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L1842"><span class="lineNum">    1842</span>              :     }</span>
<span id="L1843"><span class="lineNum">    1843</span>              : </span>
<span id="L1844"><span class="lineNum">    1844</span>              :   /**</span>
<span id="L1845"><span class="lineNum">    1845</span>              :    *  @doctodo</span>
<span id="L1846"><span class="lineNum">    1846</span>              :    *  This controls some aspect of the sort routines.</span>
<span id="L1847"><span class="lineNum">    1847</span>              :   */</span>
<span id="L1848"><span class="lineNum">    1848</span>              :   enum { _S_threshold = 16 };</span>
<span id="L1849"><span class="lineNum">    1849</span>              : </span>
<span id="L1850"><span class="lineNum">    1850</span>              :   /// This is a helper function for the sort routine.</span>
<span id="L1851"><span class="lineNum">    1851</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1852"><span class="lineNum">    1852</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1853"><span class="lineNum">    1853</span>              :     void</span>
<span id="L1854"><span class="lineNum">    1854</span>              :     __final_insertion_sort(_RandomAccessIterator __first,</span>
<span id="L1855"><span class="lineNum">    1855</span>              :                            _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L1856"><span class="lineNum">    1856</span>              :     {</span>
<span id="L1857"><span class="lineNum">    1857</span>              :       if (__last - __first &gt; int(_S_threshold))</span>
<span id="L1858"><span class="lineNum">    1858</span>              :         {</span>
<span id="L1859"><span class="lineNum">    1859</span>              :           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);</span>
<span id="L1860"><span class="lineNum">    1860</span>              :           std::__unguarded_insertion_sort(__first + int(_S_threshold), __last,</span>
<span id="L1861"><span class="lineNum">    1861</span>              :                                           __comp);</span>
<span id="L1862"><span class="lineNum">    1862</span>              :         }</span>
<span id="L1863"><span class="lineNum">    1863</span>              :       else</span>
<span id="L1864"><span class="lineNum">    1864</span>              :         std::__insertion_sort(__first, __last, __comp);</span>
<span id="L1865"><span class="lineNum">    1865</span>              :     }</span>
<span id="L1866"><span class="lineNum">    1866</span>              : </span>
<span id="L1867"><span class="lineNum">    1867</span>              :   /// This is a helper function...</span>
<span id="L1868"><span class="lineNum">    1868</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1869"><span class="lineNum">    1869</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1870"><span class="lineNum">    1870</span>              :     _RandomAccessIterator</span>
<span id="L1871"><span class="lineNum">    1871</span>              :     __unguarded_partition(_RandomAccessIterator __first,</span>
<span id="L1872"><span class="lineNum">    1872</span>              :                           _RandomAccessIterator __last,</span>
<span id="L1873"><span class="lineNum">    1873</span>              :                           _RandomAccessIterator __pivot, _Compare __comp)</span>
<span id="L1874"><span class="lineNum">    1874</span>              :     {</span>
<span id="L1875"><span class="lineNum">    1875</span>              :       while (true)</span>
<span id="L1876"><span class="lineNum">    1876</span>              :         {</span>
<span id="L1877"><span class="lineNum">    1877</span>              :           while (__comp(__first, __pivot))</span>
<span id="L1878"><span class="lineNum">    1878</span>              :             ++__first;</span>
<span id="L1879"><span class="lineNum">    1879</span>              :           --__last;</span>
<span id="L1880"><span class="lineNum">    1880</span>              :           while (__comp(__pivot, __last))</span>
<span id="L1881"><span class="lineNum">    1881</span>              :             --__last;</span>
<span id="L1882"><span class="lineNum">    1882</span>              :           if (!(__first &lt; __last))</span>
<span id="L1883"><span class="lineNum">    1883</span>              :             return __first;</span>
<span id="L1884"><span class="lineNum">    1884</span>              :           std::iter_swap(__first, __last);</span>
<span id="L1885"><span class="lineNum">    1885</span>              :           ++__first;</span>
<span id="L1886"><span class="lineNum">    1886</span>              :         }</span>
<span id="L1887"><span class="lineNum">    1887</span>              :     }</span>
<span id="L1888"><span class="lineNum">    1888</span>              : </span>
<span id="L1889"><span class="lineNum">    1889</span>              :   /// This is a helper function...</span>
<span id="L1890"><span class="lineNum">    1890</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1891"><span class="lineNum">    1891</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1892"><span class="lineNum">    1892</span>              :     inline _RandomAccessIterator</span>
<span id="L1893"><span class="lineNum">    1893</span>              :     __unguarded_partition_pivot(_RandomAccessIterator __first,</span>
<span id="L1894"><span class="lineNum">    1894</span>              :                                 _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L1895"><span class="lineNum">    1895</span>              :     {</span>
<span id="L1896"><span class="lineNum">    1896</span>              :       _RandomAccessIterator __mid = __first + (__last - __first) / 2;</span>
<span id="L1897"><span class="lineNum">    1897</span>              :       std::__move_median_to_first(__first, __first + 1, __mid, __last - 1,</span>
<span id="L1898"><span class="lineNum">    1898</span>              :                                   __comp);</span>
<span id="L1899"><span class="lineNum">    1899</span>              :       return std::__unguarded_partition(__first + 1, __last, __first, __comp);</span>
<span id="L1900"><span class="lineNum">    1900</span>              :     }</span>
<span id="L1901"><span class="lineNum">    1901</span>              : </span>
<span id="L1902"><span class="lineNum">    1902</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1903"><span class="lineNum">    1903</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1904"><span class="lineNum">    1904</span>              :     inline void</span>
<span id="L1905"><span class="lineNum">    1905</span>              :     __partial_sort(_RandomAccessIterator __first,</span>
<span id="L1906"><span class="lineNum">    1906</span>              :                    _RandomAccessIterator __middle,</span>
<span id="L1907"><span class="lineNum">    1907</span>              :                    _RandomAccessIterator __last,</span>
<span id="L1908"><span class="lineNum">    1908</span>              :                    _Compare __comp)</span>
<span id="L1909"><span class="lineNum">    1909</span>              :     {</span>
<span id="L1910"><span class="lineNum">    1910</span>              :       std::__heap_select(__first, __middle, __last, __comp);</span>
<span id="L1911"><span class="lineNum">    1911</span>              :       std::__sort_heap(__first, __middle, __comp);</span>
<span id="L1912"><span class="lineNum">    1912</span>              :     }</span>
<span id="L1913"><span class="lineNum">    1913</span>              : </span>
<span id="L1914"><span class="lineNum">    1914</span>              :   /// This is a helper function for the sort routine.</span>
<span id="L1915"><span class="lineNum">    1915</span>              :   template&lt;typename _RandomAccessIterator, typename _Size, typename _Compare&gt;</span>
<span id="L1916"><span class="lineNum">    1916</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1917"><span class="lineNum">    1917</span>              :     void</span>
<span id="L1918"><span class="lineNum">    1918</span>              :     __introsort_loop(_RandomAccessIterator __first,</span>
<span id="L1919"><span class="lineNum">    1919</span>              :                      _RandomAccessIterator __last,</span>
<span id="L1920"><span class="lineNum">    1920</span>              :                      _Size __depth_limit, _Compare __comp)</span>
<span id="L1921"><span class="lineNum">    1921</span>              :     {</span>
<span id="L1922"><span class="lineNum">    1922</span>              :       while (__last - __first &gt; int(_S_threshold))</span>
<span id="L1923"><span class="lineNum">    1923</span>              :         {</span>
<span id="L1924"><span class="lineNum">    1924</span>              :           if (__depth_limit == 0)</span>
<span id="L1925"><span class="lineNum">    1925</span>              :             {</span>
<span id="L1926"><span class="lineNum">    1926</span>              :               std::__partial_sort(__first, __last, __last, __comp);</span>
<span id="L1927"><span class="lineNum">    1927</span>              :               return;</span>
<span id="L1928"><span class="lineNum">    1928</span>              :             }</span>
<span id="L1929"><span class="lineNum">    1929</span>              :           --__depth_limit;</span>
<span id="L1930"><span class="lineNum">    1930</span>              :           _RandomAccessIterator __cut =</span>
<span id="L1931"><span class="lineNum">    1931</span>              :             std::__unguarded_partition_pivot(__first, __last, __comp);</span>
<span id="L1932"><span class="lineNum">    1932</span>              :           std::__introsort_loop(__cut, __last, __depth_limit, __comp);</span>
<span id="L1933"><span class="lineNum">    1933</span>              :           __last = __cut;</span>
<span id="L1934"><span class="lineNum">    1934</span>              :         }</span>
<span id="L1935"><span class="lineNum">    1935</span>              :     }</span>
<span id="L1936"><span class="lineNum">    1936</span>              : </span>
<span id="L1937"><span class="lineNum">    1937</span>              :   // sort</span>
<span id="L1938"><span class="lineNum">    1938</span>              : </span>
<span id="L1939"><span class="lineNum">    1939</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L1940"><span class="lineNum">    1940</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1941"><span class="lineNum">    1941</span>              :     inline void</span>
<span id="L1942"><span class="lineNum">    1942</span>              :     __sort(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L1943"><span class="lineNum">    1943</span>              :            _Compare __comp)</span>
<span id="L1944"><span class="lineNum">    1944</span>              :     {</span>
<span id="L1945"><span class="lineNum">    1945</span>              :       if (__first != __last)</span>
<span id="L1946"><span class="lineNum">    1946</span>              :         {</span>
<span id="L1947"><span class="lineNum">    1947</span>              :           std::__introsort_loop(__first, __last,</span>
<span id="L1948"><span class="lineNum">    1948</span>              :                                 std::__lg(__last - __first) * 2,</span>
<span id="L1949"><span class="lineNum">    1949</span>              :                                 __comp);</span>
<span id="L1950"><span class="lineNum">    1950</span>              :           std::__final_insertion_sort(__first, __last, __comp);</span>
<span id="L1951"><span class="lineNum">    1951</span>              :         }</span>
<span id="L1952"><span class="lineNum">    1952</span>              :     }</span>
<span id="L1953"><span class="lineNum">    1953</span>              : </span>
<span id="L1954"><span class="lineNum">    1954</span>              :   template&lt;typename _RandomAccessIterator, typename _Size, typename _Compare&gt;</span>
<span id="L1955"><span class="lineNum">    1955</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L1956"><span class="lineNum">    1956</span>              :     void</span>
<span id="L1957"><span class="lineNum">    1957</span>              :     __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,</span>
<span id="L1958"><span class="lineNum">    1958</span>              :                   _RandomAccessIterator __last, _Size __depth_limit,</span>
<span id="L1959"><span class="lineNum">    1959</span>              :                   _Compare __comp)</span>
<span id="L1960"><span class="lineNum">    1960</span>              :     {</span>
<span id="L1961"><span class="lineNum">    1961</span>              :       while (__last - __first &gt; 3)</span>
<span id="L1962"><span class="lineNum">    1962</span>              :         {</span>
<span id="L1963"><span class="lineNum">    1963</span>              :           if (__depth_limit == 0)</span>
<span id="L1964"><span class="lineNum">    1964</span>              :             {</span>
<span id="L1965"><span class="lineNum">    1965</span>              :               std::__heap_select(__first, __nth + 1, __last, __comp);</span>
<span id="L1966"><span class="lineNum">    1966</span>              :               // Place the nth largest element in its final position.</span>
<span id="L1967"><span class="lineNum">    1967</span>              :               std::iter_swap(__first, __nth);</span>
<span id="L1968"><span class="lineNum">    1968</span>              :               return;</span>
<span id="L1969"><span class="lineNum">    1969</span>              :             }</span>
<span id="L1970"><span class="lineNum">    1970</span>              :           --__depth_limit;</span>
<span id="L1971"><span class="lineNum">    1971</span>              :           _RandomAccessIterator __cut =</span>
<span id="L1972"><span class="lineNum">    1972</span>              :             std::__unguarded_partition_pivot(__first, __last, __comp);</span>
<span id="L1973"><span class="lineNum">    1973</span>              :           if (__cut &lt;= __nth)</span>
<span id="L1974"><span class="lineNum">    1974</span>              :             __first = __cut;</span>
<span id="L1975"><span class="lineNum">    1975</span>              :           else</span>
<span id="L1976"><span class="lineNum">    1976</span>              :             __last = __cut;</span>
<span id="L1977"><span class="lineNum">    1977</span>              :         }</span>
<span id="L1978"><span class="lineNum">    1978</span>              :       std::__insertion_sort(__first, __last, __comp);</span>
<span id="L1979"><span class="lineNum">    1979</span>              :     }</span>
<span id="L1980"><span class="lineNum">    1980</span>              : </span>
<span id="L1981"><span class="lineNum">    1981</span>              :   /// @endcond</span>
<span id="L1982"><span class="lineNum">    1982</span>              : </span>
<span id="L1983"><span class="lineNum">    1983</span>              :   // nth_element</span>
<span id="L1984"><span class="lineNum">    1984</span>              : </span>
<span id="L1985"><span class="lineNum">    1985</span>              :   // lower_bound moved to stl_algobase.h</span>
<span id="L1986"><span class="lineNum">    1986</span>              : </span>
<span id="L1987"><span class="lineNum">    1987</span>              :   /**</span>
<span id="L1988"><span class="lineNum">    1988</span>              :    *  @brief Finds the first position in which `__val` could be inserted</span>
<span id="L1989"><span class="lineNum">    1989</span>              :    *         without changing the ordering.</span>
<span id="L1990"><span class="lineNum">    1990</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L1991"><span class="lineNum">    1991</span>              :    *  @param  __first   An iterator to the start of a sorted range.</span>
<span id="L1992"><span class="lineNum">    1992</span>              :    *  @param  __last    A past-the-end iterator for the sorted range.</span>
<span id="L1993"><span class="lineNum">    1993</span>              :    *  @param  __val     The search term.</span>
<span id="L1994"><span class="lineNum">    1994</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L1995"><span class="lineNum">    1995</span>              :    *  @return An iterator pointing to the first element _not less than_</span>
<span id="L1996"><span class="lineNum">    1996</span>              :    *           `__val`, or `end()` if every element is less than `__val`.</span>
<span id="L1997"><span class="lineNum">    1997</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L1998"><span class="lineNum">    1998</span>              :    *</span>
<span id="L1999"><span class="lineNum">    1999</span>              :    *  The comparison function should have the same effects on ordering as</span>
<span id="L2000"><span class="lineNum">    2000</span>              :    *  the function used for the initial sort.</span>
<span id="L2001"><span class="lineNum">    2001</span>              :   */</span>
<span id="L2002"><span class="lineNum">    2002</span>              :   template&lt;typename _ForwardIterator, typename _Tp, typename _Compare&gt;</span>
<span id="L2003"><span class="lineNum">    2003</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2004"><span class="lineNum">    2004</span>              :     inline _ForwardIterator</span>
<span id="L2005"><span class="lineNum">    2005</span>              :     lower_bound(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2006"><span class="lineNum">    2006</span>              :                 const _Tp&amp; __val, _Compare __comp)</span>
<span id="L2007"><span class="lineNum">    2007</span>              :     {</span>
<span id="L2008"><span class="lineNum">    2008</span>              :       // concept requirements</span>
<span id="L2009"><span class="lineNum">    2009</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2010"><span class="lineNum">    2010</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2011"><span class="lineNum">    2011</span>              :         typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L2012"><span class="lineNum">    2012</span>              :       __glibcxx_requires_partitioned_lower_pred(__first, __last,</span>
<span id="L2013"><span class="lineNum">    2013</span>              :                                                 __val, __comp);</span>
<span id="L2014"><span class="lineNum">    2014</span>              : </span>
<span id="L2015"><span class="lineNum">    2015</span>              :       return std::__lower_bound(__first, __last, __val,</span>
<span id="L2016"><span class="lineNum">    2016</span>              :                                 __gnu_cxx::__ops::__iter_comp_val(__comp));</span>
<span id="L2017"><span class="lineNum">    2017</span>              :     }</span>
<span id="L2018"><span class="lineNum">    2018</span>              : </span>
<span id="L2019"><span class="lineNum">    2019</span>              :   template&lt;typename _ForwardIterator, typename _Tp, typename _Compare&gt;</span>
<span id="L2020"><span class="lineNum">    2020</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2021"><span class="lineNum">    2021</span>              :     _ForwardIterator</span>
<span id="L2022"><span class="lineNum">    2022</span>              :     __upper_bound(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2023"><span class="lineNum">    2023</span>              :                   const _Tp&amp; __val, _Compare __comp)</span>
<span id="L2024"><span class="lineNum">    2024</span>              :     {</span>
<span id="L2025"><span class="lineNum">    2025</span>              :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::difference_type</span>
<span id="L2026"><span class="lineNum">    2026</span>              :         _DistanceType;</span>
<span id="L2027"><span class="lineNum">    2027</span>              : </span>
<span id="L2028"><span class="lineNum">    2028</span>              :       _DistanceType __len = std::distance(__first, __last);</span>
<span id="L2029"><span class="lineNum">    2029</span>              : </span>
<span id="L2030"><span class="lineNum">    2030</span>              :       while (__len &gt; 0)</span>
<span id="L2031"><span class="lineNum">    2031</span>              :         {</span>
<span id="L2032"><span class="lineNum">    2032</span>              :           _DistanceType __half = __len &gt;&gt; 1;</span>
<span id="L2033"><span class="lineNum">    2033</span>              :           _ForwardIterator __middle = __first;</span>
<span id="L2034"><span class="lineNum">    2034</span>              :           std::advance(__middle, __half);</span>
<span id="L2035"><span class="lineNum">    2035</span>              :           if (__comp(__val, __middle))</span>
<span id="L2036"><span class="lineNum">    2036</span>              :             __len = __half;</span>
<span id="L2037"><span class="lineNum">    2037</span>              :           else</span>
<span id="L2038"><span class="lineNum">    2038</span>              :             {</span>
<span id="L2039"><span class="lineNum">    2039</span>              :               __first = __middle;</span>
<span id="L2040"><span class="lineNum">    2040</span>              :               ++__first;</span>
<span id="L2041"><span class="lineNum">    2041</span>              :               __len = __len - __half - 1;</span>
<span id="L2042"><span class="lineNum">    2042</span>              :             }</span>
<span id="L2043"><span class="lineNum">    2043</span>              :         }</span>
<span id="L2044"><span class="lineNum">    2044</span>              :       return __first;</span>
<span id="L2045"><span class="lineNum">    2045</span>              :     }</span>
<span id="L2046"><span class="lineNum">    2046</span>              : </span>
<span id="L2047"><span class="lineNum">    2047</span>              :   /**</span>
<span id="L2048"><span class="lineNum">    2048</span>              :    *  @brief Finds the last position in which @p __val could be inserted</span>
<span id="L2049"><span class="lineNum">    2049</span>              :    *         without changing the ordering.</span>
<span id="L2050"><span class="lineNum">    2050</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2051"><span class="lineNum">    2051</span>              :    *  @param  __first   An iterator.</span>
<span id="L2052"><span class="lineNum">    2052</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2053"><span class="lineNum">    2053</span>              :    *  @param  __val     The search term.</span>
<span id="L2054"><span class="lineNum">    2054</span>              :    *  @return  An iterator pointing to the first element greater than @p __val,</span>
<span id="L2055"><span class="lineNum">    2055</span>              :    *           or end() if no elements are greater than @p __val.</span>
<span id="L2056"><span class="lineNum">    2056</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2057"><span class="lineNum">    2057</span>              :   */</span>
<span id="L2058"><span class="lineNum">    2058</span>              :   template&lt;typename _ForwardIterator, typename _Tp&gt;</span>
<span id="L2059"><span class="lineNum">    2059</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2060"><span class="lineNum">    2060</span>              :     inline _ForwardIterator</span>
<span id="L2061"><span class="lineNum">    2061</span>              :     upper_bound(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2062"><span class="lineNum">    2062</span>              :                 const _Tp&amp; __val)</span>
<span id="L2063"><span class="lineNum">    2063</span>              :     {</span>
<span id="L2064"><span class="lineNum">    2064</span>              :       // concept requirements</span>
<span id="L2065"><span class="lineNum">    2065</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2066"><span class="lineNum">    2066</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2067"><span class="lineNum">    2067</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2068"><span class="lineNum">    2068</span>              :       __glibcxx_requires_partitioned_upper(__first, __last, __val);</span>
<span id="L2069"><span class="lineNum">    2069</span>              : </span>
<span id="L2070"><span class="lineNum">    2070</span>              :       return std::__upper_bound(__first, __last, __val,</span>
<span id="L2071"><span class="lineNum">    2071</span>              :                                 __gnu_cxx::__ops::__val_less_iter());</span>
<span id="L2072"><span class="lineNum">    2072</span>              :     }</span>
<span id="L2073"><span class="lineNum">    2073</span>              : </span>
<span id="L2074"><span class="lineNum">    2074</span>              :   /**</span>
<span id="L2075"><span class="lineNum">    2075</span>              :    *  @brief Finds the last position in which @p __val could be inserted</span>
<span id="L2076"><span class="lineNum">    2076</span>              :    *         without changing the ordering.</span>
<span id="L2077"><span class="lineNum">    2077</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2078"><span class="lineNum">    2078</span>              :    *  @param  __first   An iterator.</span>
<span id="L2079"><span class="lineNum">    2079</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2080"><span class="lineNum">    2080</span>              :    *  @param  __val     The search term.</span>
<span id="L2081"><span class="lineNum">    2081</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L2082"><span class="lineNum">    2082</span>              :    *  @return  An iterator pointing to the first element greater than @p __val,</span>
<span id="L2083"><span class="lineNum">    2083</span>              :    *           or end() if no elements are greater than @p __val.</span>
<span id="L2084"><span class="lineNum">    2084</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2085"><span class="lineNum">    2085</span>              :    *</span>
<span id="L2086"><span class="lineNum">    2086</span>              :    *  The comparison function should have the same effects on ordering as</span>
<span id="L2087"><span class="lineNum">    2087</span>              :    *  the function used for the initial sort.</span>
<span id="L2088"><span class="lineNum">    2088</span>              :   */</span>
<span id="L2089"><span class="lineNum">    2089</span>              :   template&lt;typename _ForwardIterator, typename _Tp, typename _Compare&gt;</span>
<span id="L2090"><span class="lineNum">    2090</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2091"><span class="lineNum">    2091</span>              :     inline _ForwardIterator</span>
<span id="L2092"><span class="lineNum">    2092</span>              :     upper_bound(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2093"><span class="lineNum">    2093</span>              :                 const _Tp&amp; __val, _Compare __comp)</span>
<span id="L2094"><span class="lineNum">    2094</span>              :     {</span>
<span id="L2095"><span class="lineNum">    2095</span>              :       // concept requirements</span>
<span id="L2096"><span class="lineNum">    2096</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2097"><span class="lineNum">    2097</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2098"><span class="lineNum">    2098</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2099"><span class="lineNum">    2099</span>              :       __glibcxx_requires_partitioned_upper_pred(__first, __last,</span>
<span id="L2100"><span class="lineNum">    2100</span>              :                                                 __val, __comp);</span>
<span id="L2101"><span class="lineNum">    2101</span>              : </span>
<span id="L2102"><span class="lineNum">    2102</span>              :       return std::__upper_bound(__first, __last, __val,</span>
<span id="L2103"><span class="lineNum">    2103</span>              :                                 __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L2104"><span class="lineNum">    2104</span>              :     }</span>
<span id="L2105"><span class="lineNum">    2105</span>              : </span>
<span id="L2106"><span class="lineNum">    2106</span>              :   template&lt;typename _ForwardIterator, typename _Tp,</span>
<span id="L2107"><span class="lineNum">    2107</span>              :            typename _CompareItTp, typename _CompareTpIt&gt;</span>
<span id="L2108"><span class="lineNum">    2108</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2109"><span class="lineNum">    2109</span>              :     pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L2110"><span class="lineNum">    2110</span>              :     __equal_range(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2111"><span class="lineNum">    2111</span>              :                   const _Tp&amp; __val,</span>
<span id="L2112"><span class="lineNum">    2112</span>              :                   _CompareItTp __comp_it_val, _CompareTpIt __comp_val_it)</span>
<span id="L2113"><span class="lineNum">    2113</span>              :     {</span>
<span id="L2114"><span class="lineNum">    2114</span>              :       typedef typename iterator_traits&lt;_ForwardIterator&gt;::difference_type</span>
<span id="L2115"><span class="lineNum">    2115</span>              :         _DistanceType;</span>
<span id="L2116"><span class="lineNum">    2116</span>              : </span>
<span id="L2117"><span class="lineNum">    2117</span>              :       _DistanceType __len = std::distance(__first, __last);</span>
<span id="L2118"><span class="lineNum">    2118</span>              : </span>
<span id="L2119"><span class="lineNum">    2119</span>              :       while (__len &gt; 0)</span>
<span id="L2120"><span class="lineNum">    2120</span>              :         {</span>
<span id="L2121"><span class="lineNum">    2121</span>              :           _DistanceType __half = __len &gt;&gt; 1;</span>
<span id="L2122"><span class="lineNum">    2122</span>              :           _ForwardIterator __middle = __first;</span>
<span id="L2123"><span class="lineNum">    2123</span>              :           std::advance(__middle, __half);</span>
<span id="L2124"><span class="lineNum">    2124</span>              :           if (__comp_it_val(__middle, __val))</span>
<span id="L2125"><span class="lineNum">    2125</span>              :             {</span>
<span id="L2126"><span class="lineNum">    2126</span>              :               __first = __middle;</span>
<span id="L2127"><span class="lineNum">    2127</span>              :               ++__first;</span>
<span id="L2128"><span class="lineNum">    2128</span>              :               __len = __len - __half - 1;</span>
<span id="L2129"><span class="lineNum">    2129</span>              :             }</span>
<span id="L2130"><span class="lineNum">    2130</span>              :           else if (__comp_val_it(__val, __middle))</span>
<span id="L2131"><span class="lineNum">    2131</span>              :             __len = __half;</span>
<span id="L2132"><span class="lineNum">    2132</span>              :           else</span>
<span id="L2133"><span class="lineNum">    2133</span>              :             {</span>
<span id="L2134"><span class="lineNum">    2134</span>              :               _ForwardIterator __left</span>
<span id="L2135"><span class="lineNum">    2135</span>              :                 = std::__lower_bound(__first, __middle, __val, __comp_it_val);</span>
<span id="L2136"><span class="lineNum">    2136</span>              :               std::advance(__first, __len);</span>
<span id="L2137"><span class="lineNum">    2137</span>              :               _ForwardIterator __right</span>
<span id="L2138"><span class="lineNum">    2138</span>              :                 = std::__upper_bound(++__middle, __first, __val, __comp_val_it);</span>
<span id="L2139"><span class="lineNum">    2139</span>              :               return pair&lt;_ForwardIterator, _ForwardIterator&gt;(__left, __right);</span>
<span id="L2140"><span class="lineNum">    2140</span>              :             }</span>
<span id="L2141"><span class="lineNum">    2141</span>              :         }</span>
<span id="L2142"><span class="lineNum">    2142</span>              :       return pair&lt;_ForwardIterator, _ForwardIterator&gt;(__first, __first);</span>
<span id="L2143"><span class="lineNum">    2143</span>              :     }</span>
<span id="L2144"><span class="lineNum">    2144</span>              : </span>
<span id="L2145"><span class="lineNum">    2145</span>              :   /**</span>
<span id="L2146"><span class="lineNum">    2146</span>              :    *  @brief Finds the largest subrange in which @p __val could be inserted</span>
<span id="L2147"><span class="lineNum">    2147</span>              :    *         at any place in it without changing the ordering.</span>
<span id="L2148"><span class="lineNum">    2148</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2149"><span class="lineNum">    2149</span>              :    *  @param  __first   An iterator.</span>
<span id="L2150"><span class="lineNum">    2150</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2151"><span class="lineNum">    2151</span>              :    *  @param  __val     The search term.</span>
<span id="L2152"><span class="lineNum">    2152</span>              :    *  @return  An pair of iterators defining the subrange.</span>
<span id="L2153"><span class="lineNum">    2153</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2154"><span class="lineNum">    2154</span>              :    *</span>
<span id="L2155"><span class="lineNum">    2155</span>              :    *  This is equivalent to</span>
<span id="L2156"><span class="lineNum">    2156</span>              :    *  @code</span>
<span id="L2157"><span class="lineNum">    2157</span>              :    *    std::make_pair(lower_bound(__first, __last, __val),</span>
<span id="L2158"><span class="lineNum">    2158</span>              :    *                   upper_bound(__first, __last, __val))</span>
<span id="L2159"><span class="lineNum">    2159</span>              :    *  @endcode</span>
<span id="L2160"><span class="lineNum">    2160</span>              :    *  but does not actually call those functions.</span>
<span id="L2161"><span class="lineNum">    2161</span>              :   */</span>
<span id="L2162"><span class="lineNum">    2162</span>              :   template&lt;typename _ForwardIterator, typename _Tp&gt;</span>
<span id="L2163"><span class="lineNum">    2163</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2164"><span class="lineNum">    2164</span>              :     inline pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L2165"><span class="lineNum">    2165</span>              :     equal_range(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2166"><span class="lineNum">    2166</span>              :                 const _Tp&amp; __val)</span>
<span id="L2167"><span class="lineNum">    2167</span>              :     {</span>
<span id="L2168"><span class="lineNum">    2168</span>              :       // concept requirements</span>
<span id="L2169"><span class="lineNum">    2169</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2170"><span class="lineNum">    2170</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2171"><span class="lineNum">    2171</span>              :         typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L2172"><span class="lineNum">    2172</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2173"><span class="lineNum">    2173</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2174"><span class="lineNum">    2174</span>              :       __glibcxx_requires_partitioned_lower(__first, __last, __val);</span>
<span id="L2175"><span class="lineNum">    2175</span>              :       __glibcxx_requires_partitioned_upper(__first, __last, __val);</span>
<span id="L2176"><span class="lineNum">    2176</span>              : </span>
<span id="L2177"><span class="lineNum">    2177</span>              :       return std::__equal_range(__first, __last, __val,</span>
<span id="L2178"><span class="lineNum">    2178</span>              :                                 __gnu_cxx::__ops::__iter_less_val(),</span>
<span id="L2179"><span class="lineNum">    2179</span>              :                                 __gnu_cxx::__ops::__val_less_iter());</span>
<span id="L2180"><span class="lineNum">    2180</span>              :     }</span>
<span id="L2181"><span class="lineNum">    2181</span>              : </span>
<span id="L2182"><span class="lineNum">    2182</span>              :   /**</span>
<span id="L2183"><span class="lineNum">    2183</span>              :    *  @brief Finds the largest subrange in which @p __val could be inserted</span>
<span id="L2184"><span class="lineNum">    2184</span>              :    *         at any place in it without changing the ordering.</span>
<span id="L2185"><span class="lineNum">    2185</span>              :    *  @param  __first   An iterator.</span>
<span id="L2186"><span class="lineNum">    2186</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2187"><span class="lineNum">    2187</span>              :    *  @param  __val     The search term.</span>
<span id="L2188"><span class="lineNum">    2188</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L2189"><span class="lineNum">    2189</span>              :    *  @return  An pair of iterators defining the subrange.</span>
<span id="L2190"><span class="lineNum">    2190</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2191"><span class="lineNum">    2191</span>              :    *</span>
<span id="L2192"><span class="lineNum">    2192</span>              :    *  This is equivalent to</span>
<span id="L2193"><span class="lineNum">    2193</span>              :    *  @code</span>
<span id="L2194"><span class="lineNum">    2194</span>              :    *    std::make_pair(lower_bound(__first, __last, __val, __comp),</span>
<span id="L2195"><span class="lineNum">    2195</span>              :    *                   upper_bound(__first, __last, __val, __comp))</span>
<span id="L2196"><span class="lineNum">    2196</span>              :    *  @endcode</span>
<span id="L2197"><span class="lineNum">    2197</span>              :    *  but does not actually call those functions.</span>
<span id="L2198"><span class="lineNum">    2198</span>              :   */</span>
<span id="L2199"><span class="lineNum">    2199</span>              :   template&lt;typename _ForwardIterator, typename _Tp, typename _Compare&gt;</span>
<span id="L2200"><span class="lineNum">    2200</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2201"><span class="lineNum">    2201</span>              :     inline pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L2202"><span class="lineNum">    2202</span>              :     equal_range(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2203"><span class="lineNum">    2203</span>              :                 const _Tp&amp; __val, _Compare __comp)</span>
<span id="L2204"><span class="lineNum">    2204</span>              :     {</span>
<span id="L2205"><span class="lineNum">    2205</span>              :       // concept requirements</span>
<span id="L2206"><span class="lineNum">    2206</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2207"><span class="lineNum">    2207</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2208"><span class="lineNum">    2208</span>              :         typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L2209"><span class="lineNum">    2209</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2210"><span class="lineNum">    2210</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2211"><span class="lineNum">    2211</span>              :       __glibcxx_requires_partitioned_lower_pred(__first, __last,</span>
<span id="L2212"><span class="lineNum">    2212</span>              :                                                 __val, __comp);</span>
<span id="L2213"><span class="lineNum">    2213</span>              :       __glibcxx_requires_partitioned_upper_pred(__first, __last,</span>
<span id="L2214"><span class="lineNum">    2214</span>              :                                                 __val, __comp);</span>
<span id="L2215"><span class="lineNum">    2215</span>              : </span>
<span id="L2216"><span class="lineNum">    2216</span>              :       return std::__equal_range(__first, __last, __val,</span>
<span id="L2217"><span class="lineNum">    2217</span>              :                                 __gnu_cxx::__ops::__iter_comp_val(__comp),</span>
<span id="L2218"><span class="lineNum">    2218</span>              :                                 __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L2219"><span class="lineNum">    2219</span>              :     }</span>
<span id="L2220"><span class="lineNum">    2220</span>              : </span>
<span id="L2221"><span class="lineNum">    2221</span>              :   /**</span>
<span id="L2222"><span class="lineNum">    2222</span>              :    *  @brief Determines whether an element exists in a range.</span>
<span id="L2223"><span class="lineNum">    2223</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2224"><span class="lineNum">    2224</span>              :    *  @param  __first   An iterator.</span>
<span id="L2225"><span class="lineNum">    2225</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2226"><span class="lineNum">    2226</span>              :    *  @param  __val     The search term.</span>
<span id="L2227"><span class="lineNum">    2227</span>              :    *  @return True if @p __val (or its equivalent) is in [@p</span>
<span id="L2228"><span class="lineNum">    2228</span>              :    *  __first,@p __last ].</span>
<span id="L2229"><span class="lineNum">    2229</span>              :    *</span>
<span id="L2230"><span class="lineNum">    2230</span>              :    *  Note that this does not actually return an iterator to @p __val.  For</span>
<span id="L2231"><span class="lineNum">    2231</span>              :    *  that, use std::find or a container's specialized find member functions.</span>
<span id="L2232"><span class="lineNum">    2232</span>              :   */</span>
<span id="L2233"><span class="lineNum">    2233</span>              :   template&lt;typename _ForwardIterator, typename _Tp&gt;</span>
<span id="L2234"><span class="lineNum">    2234</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2235"><span class="lineNum">    2235</span>              :     bool</span>
<span id="L2236"><span class="lineNum">    2236</span>              :     binary_search(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2237"><span class="lineNum">    2237</span>              :                   const _Tp&amp; __val)</span>
<span id="L2238"><span class="lineNum">    2238</span>              :     {</span>
<span id="L2239"><span class="lineNum">    2239</span>              :       // concept requirements</span>
<span id="L2240"><span class="lineNum">    2240</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2241"><span class="lineNum">    2241</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2242"><span class="lineNum">    2242</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2243"><span class="lineNum">    2243</span>              :       __glibcxx_requires_partitioned_lower(__first, __last, __val);</span>
<span id="L2244"><span class="lineNum">    2244</span>              :       __glibcxx_requires_partitioned_upper(__first, __last, __val);</span>
<span id="L2245"><span class="lineNum">    2245</span>              : </span>
<span id="L2246"><span class="lineNum">    2246</span>              :       _ForwardIterator __i</span>
<span id="L2247"><span class="lineNum">    2247</span>              :         = std::__lower_bound(__first, __last, __val,</span>
<span id="L2248"><span class="lineNum">    2248</span>              :                              __gnu_cxx::__ops::__iter_less_val());</span>
<span id="L2249"><span class="lineNum">    2249</span>              :       return __i != __last &amp;&amp; !(__val &lt; *__i);</span>
<span id="L2250"><span class="lineNum">    2250</span>              :     }</span>
<span id="L2251"><span class="lineNum">    2251</span>              : </span>
<span id="L2252"><span class="lineNum">    2252</span>              :   /**</span>
<span id="L2253"><span class="lineNum">    2253</span>              :    *  @brief Determines whether an element exists in a range.</span>
<span id="L2254"><span class="lineNum">    2254</span>              :    *  @ingroup binary_search_algorithms</span>
<span id="L2255"><span class="lineNum">    2255</span>              :    *  @param  __first   An iterator.</span>
<span id="L2256"><span class="lineNum">    2256</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2257"><span class="lineNum">    2257</span>              :    *  @param  __val     The search term.</span>
<span id="L2258"><span class="lineNum">    2258</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L2259"><span class="lineNum">    2259</span>              :    *  @return  True if @p __val (or its equivalent) is in @p [__first,__last].</span>
<span id="L2260"><span class="lineNum">    2260</span>              :    *</span>
<span id="L2261"><span class="lineNum">    2261</span>              :    *  Note that this does not actually return an iterator to @p __val.  For</span>
<span id="L2262"><span class="lineNum">    2262</span>              :    *  that, use std::find or a container's specialized find member functions.</span>
<span id="L2263"><span class="lineNum">    2263</span>              :    *</span>
<span id="L2264"><span class="lineNum">    2264</span>              :    *  The comparison function should have the same effects on ordering as</span>
<span id="L2265"><span class="lineNum">    2265</span>              :    *  the function used for the initial sort.</span>
<span id="L2266"><span class="lineNum">    2266</span>              :   */</span>
<span id="L2267"><span class="lineNum">    2267</span>              :   template&lt;typename _ForwardIterator, typename _Tp, typename _Compare&gt;</span>
<span id="L2268"><span class="lineNum">    2268</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2269"><span class="lineNum">    2269</span>              :     bool</span>
<span id="L2270"><span class="lineNum">    2270</span>              :     binary_search(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L2271"><span class="lineNum">    2271</span>              :                   const _Tp&amp; __val, _Compare __comp)</span>
<span id="L2272"><span class="lineNum">    2272</span>              :     {</span>
<span id="L2273"><span class="lineNum">    2273</span>              :       // concept requirements</span>
<span id="L2274"><span class="lineNum">    2274</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L2275"><span class="lineNum">    2275</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2276"><span class="lineNum">    2276</span>              :         _Tp, typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L2277"><span class="lineNum">    2277</span>              :       __glibcxx_requires_partitioned_lower_pred(__first, __last,</span>
<span id="L2278"><span class="lineNum">    2278</span>              :                                                 __val, __comp);</span>
<span id="L2279"><span class="lineNum">    2279</span>              :       __glibcxx_requires_partitioned_upper_pred(__first, __last,</span>
<span id="L2280"><span class="lineNum">    2280</span>              :                                                 __val, __comp);</span>
<span id="L2281"><span class="lineNum">    2281</span>              : </span>
<span id="L2282"><span class="lineNum">    2282</span>              :       _ForwardIterator __i</span>
<span id="L2283"><span class="lineNum">    2283</span>              :         = std::__lower_bound(__first, __last, __val,</span>
<span id="L2284"><span class="lineNum">    2284</span>              :                              __gnu_cxx::__ops::__iter_comp_val(__comp));</span>
<span id="L2285"><span class="lineNum">    2285</span>              :       return __i != __last &amp;&amp; !bool(__comp(__val, *__i));</span>
<span id="L2286"><span class="lineNum">    2286</span>              :     }</span>
<span id="L2287"><span class="lineNum">    2287</span>              : </span>
<span id="L2288"><span class="lineNum">    2288</span>              :   // merge</span>
<span id="L2289"><span class="lineNum">    2289</span>              : </span>
<span id="L2290"><span class="lineNum">    2290</span>              :   /// This is a helper function for the __merge_adaptive routines.</span>
<span id="L2291"><span class="lineNum">    2291</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L2292"><span class="lineNum">    2292</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L2293"><span class="lineNum">    2293</span>              :     void</span>
<span id="L2294"><span class="lineNum">    2294</span>              :     __move_merge_adaptive(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L2295"><span class="lineNum">    2295</span>              :                           _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L2296"><span class="lineNum">    2296</span>              :                           _OutputIterator __result, _Compare __comp)</span>
<span id="L2297"><span class="lineNum">    2297</span>              :     {</span>
<span id="L2298"><span class="lineNum">    2298</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L2299"><span class="lineNum">    2299</span>              :         {</span>
<span id="L2300"><span class="lineNum">    2300</span>              :           if (__comp(__first2, __first1))</span>
<span id="L2301"><span class="lineNum">    2301</span>              :             {</span>
<span id="L2302"><span class="lineNum">    2302</span>              :               *__result = _GLIBCXX_MOVE(*__first2);</span>
<span id="L2303"><span class="lineNum">    2303</span>              :               ++__first2;</span>
<span id="L2304"><span class="lineNum">    2304</span>              :             }</span>
<span id="L2305"><span class="lineNum">    2305</span>              :           else</span>
<span id="L2306"><span class="lineNum">    2306</span>              :             {</span>
<span id="L2307"><span class="lineNum">    2307</span>              :               *__result = _GLIBCXX_MOVE(*__first1);</span>
<span id="L2308"><span class="lineNum">    2308</span>              :               ++__first1;</span>
<span id="L2309"><span class="lineNum">    2309</span>              :             }</span>
<span id="L2310"><span class="lineNum">    2310</span>              :           ++__result;</span>
<span id="L2311"><span class="lineNum">    2311</span>              :         }</span>
<span id="L2312"><span class="lineNum">    2312</span>              :       if (__first1 != __last1)</span>
<span id="L2313"><span class="lineNum">    2313</span>              :         _GLIBCXX_MOVE3(__first1, __last1, __result);</span>
<span id="L2314"><span class="lineNum">    2314</span>              :     }</span>
<span id="L2315"><span class="lineNum">    2315</span>              : </span>
<span id="L2316"><span class="lineNum">    2316</span>              :   /// This is a helper function for the __merge_adaptive routines.</span>
<span id="L2317"><span class="lineNum">    2317</span>              :   template&lt;typename _BidirectionalIterator1, typename _BidirectionalIterator2,</span>
<span id="L2318"><span class="lineNum">    2318</span>              :            typename _BidirectionalIterator3, typename _Compare&gt;</span>
<span id="L2319"><span class="lineNum">    2319</span>              :     void</span>
<span id="L2320"><span class="lineNum">    2320</span>              :     __move_merge_adaptive_backward(_BidirectionalIterator1 __first1,</span>
<span id="L2321"><span class="lineNum">    2321</span>              :                                    _BidirectionalIterator1 __last1,</span>
<span id="L2322"><span class="lineNum">    2322</span>              :                                    _BidirectionalIterator2 __first2,</span>
<span id="L2323"><span class="lineNum">    2323</span>              :                                    _BidirectionalIterator2 __last2,</span>
<span id="L2324"><span class="lineNum">    2324</span>              :                                    _BidirectionalIterator3 __result,</span>
<span id="L2325"><span class="lineNum">    2325</span>              :                                    _Compare __comp)</span>
<span id="L2326"><span class="lineNum">    2326</span>              :     {</span>
<span id="L2327"><span class="lineNum">    2327</span>              :       if (__first1 == __last1)</span>
<span id="L2328"><span class="lineNum">    2328</span>              :         {</span>
<span id="L2329"><span class="lineNum">    2329</span>              :           _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result);</span>
<span id="L2330"><span class="lineNum">    2330</span>              :           return;</span>
<span id="L2331"><span class="lineNum">    2331</span>              :         }</span>
<span id="L2332"><span class="lineNum">    2332</span>              :       else if (__first2 == __last2)</span>
<span id="L2333"><span class="lineNum">    2333</span>              :         return;</span>
<span id="L2334"><span class="lineNum">    2334</span>              : </span>
<span id="L2335"><span class="lineNum">    2335</span>              :       --__last1;</span>
<span id="L2336"><span class="lineNum">    2336</span>              :       --__last2;</span>
<span id="L2337"><span class="lineNum">    2337</span>              :       while (true)</span>
<span id="L2338"><span class="lineNum">    2338</span>              :         {</span>
<span id="L2339"><span class="lineNum">    2339</span>              :           if (__comp(__last2, __last1))</span>
<span id="L2340"><span class="lineNum">    2340</span>              :             {</span>
<span id="L2341"><span class="lineNum">    2341</span>              :               *--__result = _GLIBCXX_MOVE(*__last1);</span>
<span id="L2342"><span class="lineNum">    2342</span>              :               if (__first1 == __last1)</span>
<span id="L2343"><span class="lineNum">    2343</span>              :                 {</span>
<span id="L2344"><span class="lineNum">    2344</span>              :                   _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result);</span>
<span id="L2345"><span class="lineNum">    2345</span>              :                   return;</span>
<span id="L2346"><span class="lineNum">    2346</span>              :                 }</span>
<span id="L2347"><span class="lineNum">    2347</span>              :               --__last1;</span>
<span id="L2348"><span class="lineNum">    2348</span>              :             }</span>
<span id="L2349"><span class="lineNum">    2349</span>              :           else</span>
<span id="L2350"><span class="lineNum">    2350</span>              :             {</span>
<span id="L2351"><span class="lineNum">    2351</span>              :               *--__result = _GLIBCXX_MOVE(*__last2);</span>
<span id="L2352"><span class="lineNum">    2352</span>              :               if (__first2 == __last2)</span>
<span id="L2353"><span class="lineNum">    2353</span>              :                 return;</span>
<span id="L2354"><span class="lineNum">    2354</span>              :               --__last2;</span>
<span id="L2355"><span class="lineNum">    2355</span>              :             }</span>
<span id="L2356"><span class="lineNum">    2356</span>              :         }</span>
<span id="L2357"><span class="lineNum">    2357</span>              :     }</span>
<span id="L2358"><span class="lineNum">    2358</span>              : </span>
<span id="L2359"><span class="lineNum">    2359</span>              :   /// This is a helper function for the merge routines.</span>
<span id="L2360"><span class="lineNum">    2360</span>              :   template&lt;typename _BidirectionalIterator1, typename _BidirectionalIterator2,</span>
<span id="L2361"><span class="lineNum">    2361</span>              :            typename _Distance&gt;</span>
<span id="L2362"><span class="lineNum">    2362</span>              :     _BidirectionalIterator1</span>
<span id="L2363"><span class="lineNum">    2363</span>              :     __rotate_adaptive(_BidirectionalIterator1 __first,</span>
<span id="L2364"><span class="lineNum">    2364</span>              :                       _BidirectionalIterator1 __middle,</span>
<span id="L2365"><span class="lineNum">    2365</span>              :                       _BidirectionalIterator1 __last,</span>
<span id="L2366"><span class="lineNum">    2366</span>              :                       _Distance __len1, _Distance __len2,</span>
<span id="L2367"><span class="lineNum">    2367</span>              :                       _BidirectionalIterator2 __buffer,</span>
<span id="L2368"><span class="lineNum">    2368</span>              :                       _Distance __buffer_size)</span>
<span id="L2369"><span class="lineNum">    2369</span>              :     {</span>
<span id="L2370"><span class="lineNum">    2370</span>              :       _BidirectionalIterator2 __buffer_end;</span>
<span id="L2371"><span class="lineNum">    2371</span>              :       if (__len1 &gt; __len2 &amp;&amp; __len2 &lt;= __buffer_size)</span>
<span id="L2372"><span class="lineNum">    2372</span>              :         {</span>
<span id="L2373"><span class="lineNum">    2373</span>              :           if (__len2)</span>
<span id="L2374"><span class="lineNum">    2374</span>              :             {</span>
<span id="L2375"><span class="lineNum">    2375</span>              :               __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);</span>
<span id="L2376"><span class="lineNum">    2376</span>              :               _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last);</span>
<span id="L2377"><span class="lineNum">    2377</span>              :               return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first);</span>
<span id="L2378"><span class="lineNum">    2378</span>              :             }</span>
<span id="L2379"><span class="lineNum">    2379</span>              :           else</span>
<span id="L2380"><span class="lineNum">    2380</span>              :             return __first;</span>
<span id="L2381"><span class="lineNum">    2381</span>              :         }</span>
<span id="L2382"><span class="lineNum">    2382</span>              :       else if (__len1 &lt;= __buffer_size)</span>
<span id="L2383"><span class="lineNum">    2383</span>              :         {</span>
<span id="L2384"><span class="lineNum">    2384</span>              :           if (__len1)</span>
<span id="L2385"><span class="lineNum">    2385</span>              :             {</span>
<span id="L2386"><span class="lineNum">    2386</span>              :               __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);</span>
<span id="L2387"><span class="lineNum">    2387</span>              :               _GLIBCXX_MOVE3(__middle, __last, __first);</span>
<span id="L2388"><span class="lineNum">    2388</span>              :               return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __last);</span>
<span id="L2389"><span class="lineNum">    2389</span>              :             }</span>
<span id="L2390"><span class="lineNum">    2390</span>              :           else</span>
<span id="L2391"><span class="lineNum">    2391</span>              :             return __last;</span>
<span id="L2392"><span class="lineNum">    2392</span>              :         }</span>
<span id="L2393"><span class="lineNum">    2393</span>              :       else</span>
<span id="L2394"><span class="lineNum">    2394</span>              :         return std::rotate(__first, __middle, __last);</span>
<span id="L2395"><span class="lineNum">    2395</span>              :     }</span>
<span id="L2396"><span class="lineNum">    2396</span>              : </span>
<span id="L2397"><span class="lineNum">    2397</span>              :   /// This is a helper function for the merge routines.</span>
<span id="L2398"><span class="lineNum">    2398</span>              :   template&lt;typename _BidirectionalIterator, typename _Distance,</span>
<span id="L2399"><span class="lineNum">    2399</span>              :            typename _Pointer, typename _Compare&gt;</span>
<span id="L2400"><span class="lineNum">    2400</span>              :     void</span>
<span id="L2401"><span class="lineNum">    2401</span>              :     __merge_adaptive(_BidirectionalIterator __first,</span>
<span id="L2402"><span class="lineNum">    2402</span>              :                      _BidirectionalIterator __middle,</span>
<span id="L2403"><span class="lineNum">    2403</span>              :                      _BidirectionalIterator __last,</span>
<span id="L2404"><span class="lineNum">    2404</span>              :                      _Distance __len1, _Distance __len2,</span>
<span id="L2405"><span class="lineNum">    2405</span>              :                      _Pointer __buffer, _Compare __comp)</span>
<span id="L2406"><span class="lineNum">    2406</span>              :     {</span>
<span id="L2407"><span class="lineNum">    2407</span>              :       if (__len1 &lt;= __len2)</span>
<span id="L2408"><span class="lineNum">    2408</span>              :         {</span>
<span id="L2409"><span class="lineNum">    2409</span>              :           _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);</span>
<span id="L2410"><span class="lineNum">    2410</span>              :           std::__move_merge_adaptive(__buffer, __buffer_end, __middle, __last,</span>
<span id="L2411"><span class="lineNum">    2411</span>              :                                      __first, __comp);</span>
<span id="L2412"><span class="lineNum">    2412</span>              :         }</span>
<span id="L2413"><span class="lineNum">    2413</span>              :       else</span>
<span id="L2414"><span class="lineNum">    2414</span>              :         {</span>
<span id="L2415"><span class="lineNum">    2415</span>              :           _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer);</span>
<span id="L2416"><span class="lineNum">    2416</span>              :           std::__move_merge_adaptive_backward(__first, __middle, __buffer,</span>
<span id="L2417"><span class="lineNum">    2417</span>              :                                               __buffer_end, __last, __comp);</span>
<span id="L2418"><span class="lineNum">    2418</span>              :         }</span>
<span id="L2419"><span class="lineNum">    2419</span>              :     }</span>
<span id="L2420"><span class="lineNum">    2420</span>              : </span>
<span id="L2421"><span class="lineNum">    2421</span>              :   template&lt;typename _BidirectionalIterator, typename _Distance,</span>
<span id="L2422"><span class="lineNum">    2422</span>              :            typename _Pointer, typename _Compare&gt;</span>
<span id="L2423"><span class="lineNum">    2423</span>              :     void</span>
<span id="L2424"><span class="lineNum">    2424</span>              :     __merge_adaptive_resize(_BidirectionalIterator __first,</span>
<span id="L2425"><span class="lineNum">    2425</span>              :                             _BidirectionalIterator __middle,</span>
<span id="L2426"><span class="lineNum">    2426</span>              :                             _BidirectionalIterator __last,</span>
<span id="L2427"><span class="lineNum">    2427</span>              :                             _Distance __len1, _Distance __len2,</span>
<span id="L2428"><span class="lineNum">    2428</span>              :                             _Pointer __buffer, _Distance __buffer_size,</span>
<span id="L2429"><span class="lineNum">    2429</span>              :                             _Compare __comp)</span>
<span id="L2430"><span class="lineNum">    2430</span>              :     {</span>
<span id="L2431"><span class="lineNum">    2431</span>              :       if (__len1 &lt;= __buffer_size || __len2 &lt;= __buffer_size)</span>
<span id="L2432"><span class="lineNum">    2432</span>              :         std::__merge_adaptive(__first, __middle, __last,</span>
<span id="L2433"><span class="lineNum">    2433</span>              :                               __len1, __len2, __buffer, __comp);</span>
<span id="L2434"><span class="lineNum">    2434</span>              :       else</span>
<span id="L2435"><span class="lineNum">    2435</span>              :         {</span>
<span id="L2436"><span class="lineNum">    2436</span>              :           _BidirectionalIterator __first_cut = __first;</span>
<span id="L2437"><span class="lineNum">    2437</span>              :           _BidirectionalIterator __second_cut = __middle;</span>
<span id="L2438"><span class="lineNum">    2438</span>              :           _Distance __len11 = 0;</span>
<span id="L2439"><span class="lineNum">    2439</span>              :           _Distance __len22 = 0;</span>
<span id="L2440"><span class="lineNum">    2440</span>              :           if (__len1 &gt; __len2)</span>
<span id="L2441"><span class="lineNum">    2441</span>              :             {</span>
<span id="L2442"><span class="lineNum">    2442</span>              :               __len11 = __len1 / 2;</span>
<span id="L2443"><span class="lineNum">    2443</span>              :               std::advance(__first_cut, __len11);</span>
<span id="L2444"><span class="lineNum">    2444</span>              :               __second_cut</span>
<span id="L2445"><span class="lineNum">    2445</span>              :                 = std::__lower_bound(__middle, __last, *__first_cut,</span>
<span id="L2446"><span class="lineNum">    2446</span>              :                                      __gnu_cxx::__ops::__iter_comp_val(__comp));</span>
<span id="L2447"><span class="lineNum">    2447</span>              :               __len22 = std::distance(__middle, __second_cut);</span>
<span id="L2448"><span class="lineNum">    2448</span>              :             }</span>
<span id="L2449"><span class="lineNum">    2449</span>              :           else</span>
<span id="L2450"><span class="lineNum">    2450</span>              :             {</span>
<span id="L2451"><span class="lineNum">    2451</span>              :               __len22 = __len2 / 2;</span>
<span id="L2452"><span class="lineNum">    2452</span>              :               std::advance(__second_cut, __len22);</span>
<span id="L2453"><span class="lineNum">    2453</span>              :               __first_cut</span>
<span id="L2454"><span class="lineNum">    2454</span>              :                 = std::__upper_bound(__first, __middle, *__second_cut,</span>
<span id="L2455"><span class="lineNum">    2455</span>              :                                      __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L2456"><span class="lineNum">    2456</span>              :               __len11 = std::distance(__first, __first_cut);</span>
<span id="L2457"><span class="lineNum">    2457</span>              :             }</span>
<span id="L2458"><span class="lineNum">    2458</span>              : </span>
<span id="L2459"><span class="lineNum">    2459</span>              :           _BidirectionalIterator __new_middle</span>
<span id="L2460"><span class="lineNum">    2460</span>              :             = std::__rotate_adaptive(__first_cut, __middle, __second_cut,</span>
<span id="L2461"><span class="lineNum">    2461</span>              :                                      _Distance(__len1 - __len11), __len22,</span>
<span id="L2462"><span class="lineNum">    2462</span>              :                                      __buffer, __buffer_size);</span>
<span id="L2463"><span class="lineNum">    2463</span>              :           std::__merge_adaptive_resize(__first, __first_cut, __new_middle,</span>
<span id="L2464"><span class="lineNum">    2464</span>              :                                        __len11, __len22,</span>
<span id="L2465"><span class="lineNum">    2465</span>              :                                        __buffer, __buffer_size, __comp);</span>
<span id="L2466"><span class="lineNum">    2466</span>              :           std::__merge_adaptive_resize(__new_middle, __second_cut, __last,</span>
<span id="L2467"><span class="lineNum">    2467</span>              :                                        _Distance(__len1 - __len11),</span>
<span id="L2468"><span class="lineNum">    2468</span>              :                                        _Distance(__len2 - __len22),</span>
<span id="L2469"><span class="lineNum">    2469</span>              :                                        __buffer, __buffer_size, __comp);</span>
<span id="L2470"><span class="lineNum">    2470</span>              :         }</span>
<span id="L2471"><span class="lineNum">    2471</span>              :     }</span>
<span id="L2472"><span class="lineNum">    2472</span>              : </span>
<span id="L2473"><span class="lineNum">    2473</span>              :   /// This is a helper function for the merge routines.</span>
<span id="L2474"><span class="lineNum">    2474</span>              :   template&lt;typename _BidirectionalIterator, typename _Distance,</span>
<span id="L2475"><span class="lineNum">    2475</span>              :            typename _Compare&gt;</span>
<span id="L2476"><span class="lineNum">    2476</span>              :     void</span>
<span id="L2477"><span class="lineNum">    2477</span>              :     __merge_without_buffer(_BidirectionalIterator __first,</span>
<span id="L2478"><span class="lineNum">    2478</span>              :                            _BidirectionalIterator __middle,</span>
<span id="L2479"><span class="lineNum">    2479</span>              :                            _BidirectionalIterator __last,</span>
<span id="L2480"><span class="lineNum">    2480</span>              :                            _Distance __len1, _Distance __len2,</span>
<span id="L2481"><span class="lineNum">    2481</span>              :                            _Compare __comp)</span>
<span id="L2482"><span class="lineNum">    2482</span>              :     {</span>
<span id="L2483"><span class="lineNum">    2483</span>              :       if (__len1 == 0 || __len2 == 0)</span>
<span id="L2484"><span class="lineNum">    2484</span>              :         return;</span>
<span id="L2485"><span class="lineNum">    2485</span>              : </span>
<span id="L2486"><span class="lineNum">    2486</span>              :       if (__len1 + __len2 == 2)</span>
<span id="L2487"><span class="lineNum">    2487</span>              :         {</span>
<span id="L2488"><span class="lineNum">    2488</span>              :           if (__comp(__middle, __first))</span>
<span id="L2489"><span class="lineNum">    2489</span>              :             std::iter_swap(__first, __middle);</span>
<span id="L2490"><span class="lineNum">    2490</span>              :           return;</span>
<span id="L2491"><span class="lineNum">    2491</span>              :         }</span>
<span id="L2492"><span class="lineNum">    2492</span>              : </span>
<span id="L2493"><span class="lineNum">    2493</span>              :       _BidirectionalIterator __first_cut = __first;</span>
<span id="L2494"><span class="lineNum">    2494</span>              :       _BidirectionalIterator __second_cut = __middle;</span>
<span id="L2495"><span class="lineNum">    2495</span>              :       _Distance __len11 = 0;</span>
<span id="L2496"><span class="lineNum">    2496</span>              :       _Distance __len22 = 0;</span>
<span id="L2497"><span class="lineNum">    2497</span>              :       if (__len1 &gt; __len2)</span>
<span id="L2498"><span class="lineNum">    2498</span>              :         {</span>
<span id="L2499"><span class="lineNum">    2499</span>              :           __len11 = __len1 / 2;</span>
<span id="L2500"><span class="lineNum">    2500</span>              :           std::advance(__first_cut, __len11);</span>
<span id="L2501"><span class="lineNum">    2501</span>              :           __second_cut</span>
<span id="L2502"><span class="lineNum">    2502</span>              :             = std::__lower_bound(__middle, __last, *__first_cut,</span>
<span id="L2503"><span class="lineNum">    2503</span>              :                                  __gnu_cxx::__ops::__iter_comp_val(__comp));</span>
<span id="L2504"><span class="lineNum">    2504</span>              :           __len22 = std::distance(__middle, __second_cut);</span>
<span id="L2505"><span class="lineNum">    2505</span>              :         }</span>
<span id="L2506"><span class="lineNum">    2506</span>              :       else</span>
<span id="L2507"><span class="lineNum">    2507</span>              :         {</span>
<span id="L2508"><span class="lineNum">    2508</span>              :           __len22 = __len2 / 2;</span>
<span id="L2509"><span class="lineNum">    2509</span>              :           std::advance(__second_cut, __len22);</span>
<span id="L2510"><span class="lineNum">    2510</span>              :           __first_cut</span>
<span id="L2511"><span class="lineNum">    2511</span>              :             = std::__upper_bound(__first, __middle, *__second_cut,</span>
<span id="L2512"><span class="lineNum">    2512</span>              :                                  __gnu_cxx::__ops::__val_comp_iter(__comp));</span>
<span id="L2513"><span class="lineNum">    2513</span>              :           __len11 = std::distance(__first, __first_cut);</span>
<span id="L2514"><span class="lineNum">    2514</span>              :         }</span>
<span id="L2515"><span class="lineNum">    2515</span>              : </span>
<span id="L2516"><span class="lineNum">    2516</span>              :       _BidirectionalIterator __new_middle</span>
<span id="L2517"><span class="lineNum">    2517</span>              :         = std::rotate(__first_cut, __middle, __second_cut);</span>
<span id="L2518"><span class="lineNum">    2518</span>              :       std::__merge_without_buffer(__first, __first_cut, __new_middle,</span>
<span id="L2519"><span class="lineNum">    2519</span>              :                                   __len11, __len22, __comp);</span>
<span id="L2520"><span class="lineNum">    2520</span>              :       std::__merge_without_buffer(__new_middle, __second_cut, __last,</span>
<span id="L2521"><span class="lineNum">    2521</span>              :                                   __len1 - __len11, __len2 - __len22, __comp);</span>
<span id="L2522"><span class="lineNum">    2522</span>              :     }</span>
<span id="L2523"><span class="lineNum">    2523</span>              : </span>
<span id="L2524"><span class="lineNum">    2524</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L2525"><span class="lineNum">    2525</span>              :     void</span>
<span id="L2526"><span class="lineNum">    2526</span>              :     __inplace_merge(_BidirectionalIterator __first,</span>
<span id="L2527"><span class="lineNum">    2527</span>              :                     _BidirectionalIterator __middle,</span>
<span id="L2528"><span class="lineNum">    2528</span>              :                     _BidirectionalIterator __last,</span>
<span id="L2529"><span class="lineNum">    2529</span>              :                     _Compare __comp)</span>
<span id="L2530"><span class="lineNum">    2530</span>              :     {</span>
<span id="L2531"><span class="lineNum">    2531</span>              :       typedef typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type</span>
<span id="L2532"><span class="lineNum">    2532</span>              :           _ValueType;</span>
<span id="L2533"><span class="lineNum">    2533</span>              :       typedef typename iterator_traits&lt;_BidirectionalIterator&gt;::difference_type</span>
<span id="L2534"><span class="lineNum">    2534</span>              :           _DistanceType;</span>
<span id="L2535"><span class="lineNum">    2535</span>              : </span>
<span id="L2536"><span class="lineNum">    2536</span>              :       if (__first == __middle || __middle == __last)</span>
<span id="L2537"><span class="lineNum">    2537</span>              :         return;</span>
<span id="L2538"><span class="lineNum">    2538</span>              : </span>
<span id="L2539"><span class="lineNum">    2539</span>              :       const _DistanceType __len1 = std::distance(__first, __middle);</span>
<span id="L2540"><span class="lineNum">    2540</span>              :       const _DistanceType __len2 = std::distance(__middle, __last);</span>
<span id="L2541"><span class="lineNum">    2541</span>              : </span>
<span id="L2542"><span class="lineNum">    2542</span>              : #if _GLIBCXX_HOSTED</span>
<span id="L2543"><span class="lineNum">    2543</span>              :       typedef _Temporary_buffer&lt;_BidirectionalIterator, _ValueType&gt; _TmpBuf;</span>
<span id="L2544"><span class="lineNum">    2544</span>              :       // __merge_adaptive will use a buffer for the smaller of</span>
<span id="L2545"><span class="lineNum">    2545</span>              :       // [first,middle) and [middle,last).</span>
<span id="L2546"><span class="lineNum">    2546</span>              :       _TmpBuf __buf(__first, std::min(__len1, __len2));</span>
<span id="L2547"><span class="lineNum">    2547</span>              : </span>
<span id="L2548"><span class="lineNum">    2548</span>              :       if (__builtin_expect(__buf.size() == __buf.requested_size(), true))</span>
<span id="L2549"><span class="lineNum">    2549</span>              :         std::__merge_adaptive</span>
<span id="L2550"><span class="lineNum">    2550</span>              :           (__first, __middle, __last, __len1, __len2, __buf.begin(), __comp);</span>
<span id="L2551"><span class="lineNum">    2551</span>              :       else if (__builtin_expect(__buf.begin() == 0, false))</span>
<span id="L2552"><span class="lineNum">    2552</span>              :         std::__merge_without_buffer</span>
<span id="L2553"><span class="lineNum">    2553</span>              :           (__first, __middle, __last, __len1, __len2, __comp);</span>
<span id="L2554"><span class="lineNum">    2554</span>              :       else</span>
<span id="L2555"><span class="lineNum">    2555</span>              :         std::__merge_adaptive_resize</span>
<span id="L2556"><span class="lineNum">    2556</span>              :           (__first, __middle, __last, __len1, __len2, __buf.begin(),</span>
<span id="L2557"><span class="lineNum">    2557</span>              :            _DistanceType(__buf.size()), __comp);</span>
<span id="L2558"><span class="lineNum">    2558</span>              : #else</span>
<span id="L2559"><span class="lineNum">    2559</span>              :       std::__merge_without_buffer</span>
<span id="L2560"><span class="lineNum">    2560</span>              :         (__first, __middle, __last, __len1, __len2, __comp);</span>
<span id="L2561"><span class="lineNum">    2561</span>              : #endif</span>
<span id="L2562"><span class="lineNum">    2562</span>              :     }</span>
<span id="L2563"><span class="lineNum">    2563</span>              : </span>
<span id="L2564"><span class="lineNum">    2564</span>              :   /**</span>
<span id="L2565"><span class="lineNum">    2565</span>              :    *  @brief Merges two sorted ranges in place.</span>
<span id="L2566"><span class="lineNum">    2566</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L2567"><span class="lineNum">    2567</span>              :    *  @param  __first   An iterator.</span>
<span id="L2568"><span class="lineNum">    2568</span>              :    *  @param  __middle  Another iterator.</span>
<span id="L2569"><span class="lineNum">    2569</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2570"><span class="lineNum">    2570</span>              :    *  @return  Nothing.</span>
<span id="L2571"><span class="lineNum">    2571</span>              :    *</span>
<span id="L2572"><span class="lineNum">    2572</span>              :    *  Merges two sorted and consecutive ranges, [__first,__middle) and</span>
<span id="L2573"><span class="lineNum">    2573</span>              :    *  [__middle,__last), and puts the result in [__first,__last).  The</span>
<span id="L2574"><span class="lineNum">    2574</span>              :    *  output will be sorted.  The sort is @e stable, that is, for</span>
<span id="L2575"><span class="lineNum">    2575</span>              :    *  equivalent elements in the two ranges, elements from the first</span>
<span id="L2576"><span class="lineNum">    2576</span>              :    *  range will always come before elements from the second.</span>
<span id="L2577"><span class="lineNum">    2577</span>              :    *</span>
<span id="L2578"><span class="lineNum">    2578</span>              :    *  If enough additional memory is available, this takes (__last-__first)-1</span>
<span id="L2579"><span class="lineNum">    2579</span>              :    *  comparisons.  Otherwise an NlogN algorithm is used, where N is</span>
<span id="L2580"><span class="lineNum">    2580</span>              :    *  distance(__first,__last).</span>
<span id="L2581"><span class="lineNum">    2581</span>              :   */</span>
<span id="L2582"><span class="lineNum">    2582</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L2583"><span class="lineNum">    2583</span>              :     inline void</span>
<span id="L2584"><span class="lineNum">    2584</span>              :     inplace_merge(_BidirectionalIterator __first,</span>
<span id="L2585"><span class="lineNum">    2585</span>              :                   _BidirectionalIterator __middle,</span>
<span id="L2586"><span class="lineNum">    2586</span>              :                   _BidirectionalIterator __last)</span>
<span id="L2587"><span class="lineNum">    2587</span>              :     {</span>
<span id="L2588"><span class="lineNum">    2588</span>              :       // concept requirements</span>
<span id="L2589"><span class="lineNum">    2589</span>              :       __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept&lt;</span>
<span id="L2590"><span class="lineNum">    2590</span>              :             _BidirectionalIterator&gt;)</span>
<span id="L2591"><span class="lineNum">    2591</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L2592"><span class="lineNum">    2592</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L2593"><span class="lineNum">    2593</span>              :       __glibcxx_requires_sorted(__first, __middle);</span>
<span id="L2594"><span class="lineNum">    2594</span>              :       __glibcxx_requires_sorted(__middle, __last);</span>
<span id="L2595"><span class="lineNum">    2595</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L2596"><span class="lineNum">    2596</span>              : </span>
<span id="L2597"><span class="lineNum">    2597</span>              :       std::__inplace_merge(__first, __middle, __last,</span>
<span id="L2598"><span class="lineNum">    2598</span>              :                            __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L2599"><span class="lineNum">    2599</span>              :     }</span>
<span id="L2600"><span class="lineNum">    2600</span>              : </span>
<span id="L2601"><span class="lineNum">    2601</span>              :   /**</span>
<span id="L2602"><span class="lineNum">    2602</span>              :    *  @brief Merges two sorted ranges in place.</span>
<span id="L2603"><span class="lineNum">    2603</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L2604"><span class="lineNum">    2604</span>              :    *  @param  __first   An iterator.</span>
<span id="L2605"><span class="lineNum">    2605</span>              :    *  @param  __middle  Another iterator.</span>
<span id="L2606"><span class="lineNum">    2606</span>              :    *  @param  __last    Another iterator.</span>
<span id="L2607"><span class="lineNum">    2607</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L2608"><span class="lineNum">    2608</span>              :    *  @return  Nothing.</span>
<span id="L2609"><span class="lineNum">    2609</span>              :    *</span>
<span id="L2610"><span class="lineNum">    2610</span>              :    *  Merges two sorted and consecutive ranges, [__first,__middle) and</span>
<span id="L2611"><span class="lineNum">    2611</span>              :    *  [middle,last), and puts the result in [__first,__last).  The output will</span>
<span id="L2612"><span class="lineNum">    2612</span>              :    *  be sorted.  The sort is @e stable, that is, for equivalent</span>
<span id="L2613"><span class="lineNum">    2613</span>              :    *  elements in the two ranges, elements from the first range will always</span>
<span id="L2614"><span class="lineNum">    2614</span>              :    *  come before elements from the second.</span>
<span id="L2615"><span class="lineNum">    2615</span>              :    *</span>
<span id="L2616"><span class="lineNum">    2616</span>              :    *  If enough additional memory is available, this takes (__last-__first)-1</span>
<span id="L2617"><span class="lineNum">    2617</span>              :    *  comparisons.  Otherwise an NlogN algorithm is used, where N is</span>
<span id="L2618"><span class="lineNum">    2618</span>              :    *  distance(__first,__last).</span>
<span id="L2619"><span class="lineNum">    2619</span>              :    *</span>
<span id="L2620"><span class="lineNum">    2620</span>              :    *  The comparison function should have the same effects on ordering as</span>
<span id="L2621"><span class="lineNum">    2621</span>              :    *  the function used for the initial sort.</span>
<span id="L2622"><span class="lineNum">    2622</span>              :   */</span>
<span id="L2623"><span class="lineNum">    2623</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L2624"><span class="lineNum">    2624</span>              :     inline void</span>
<span id="L2625"><span class="lineNum">    2625</span>              :     inplace_merge(_BidirectionalIterator __first,</span>
<span id="L2626"><span class="lineNum">    2626</span>              :                   _BidirectionalIterator __middle,</span>
<span id="L2627"><span class="lineNum">    2627</span>              :                   _BidirectionalIterator __last,</span>
<span id="L2628"><span class="lineNum">    2628</span>              :                   _Compare __comp)</span>
<span id="L2629"><span class="lineNum">    2629</span>              :     {</span>
<span id="L2630"><span class="lineNum">    2630</span>              :       // concept requirements</span>
<span id="L2631"><span class="lineNum">    2631</span>              :       __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept&lt;</span>
<span id="L2632"><span class="lineNum">    2632</span>              :             _BidirectionalIterator&gt;)</span>
<span id="L2633"><span class="lineNum">    2633</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2634"><span class="lineNum">    2634</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type,</span>
<span id="L2635"><span class="lineNum">    2635</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L2636"><span class="lineNum">    2636</span>              :       __glibcxx_requires_sorted_pred(__first, __middle, __comp);</span>
<span id="L2637"><span class="lineNum">    2637</span>              :       __glibcxx_requires_sorted_pred(__middle, __last, __comp);</span>
<span id="L2638"><span class="lineNum">    2638</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L2639"><span class="lineNum">    2639</span>              : </span>
<span id="L2640"><span class="lineNum">    2640</span>              :       std::__inplace_merge(__first, __middle, __last,</span>
<span id="L2641"><span class="lineNum">    2641</span>              :                            __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L2642"><span class="lineNum">    2642</span>              :     }</span>
<span id="L2643"><span class="lineNum">    2643</span>              : </span>
<span id="L2644"><span class="lineNum">    2644</span>              : </span>
<span id="L2645"><span class="lineNum">    2645</span>              :   /// This is a helper function for the __merge_sort_loop routines.</span>
<span id="L2646"><span class="lineNum">    2646</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L2647"><span class="lineNum">    2647</span>              :            typename _Compare&gt;</span>
<span id="L2648"><span class="lineNum">    2648</span>              :     _OutputIterator</span>
<span id="L2649"><span class="lineNum">    2649</span>              :     __move_merge(_InputIterator __first1, _InputIterator __last1,</span>
<span id="L2650"><span class="lineNum">    2650</span>              :                  _InputIterator __first2, _InputIterator __last2,</span>
<span id="L2651"><span class="lineNum">    2651</span>              :                  _OutputIterator __result, _Compare __comp)</span>
<span id="L2652"><span class="lineNum">    2652</span>              :     {</span>
<span id="L2653"><span class="lineNum">    2653</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L2654"><span class="lineNum">    2654</span>              :         {</span>
<span id="L2655"><span class="lineNum">    2655</span>              :           if (__comp(__first2, __first1))</span>
<span id="L2656"><span class="lineNum">    2656</span>              :             {</span>
<span id="L2657"><span class="lineNum">    2657</span>              :               *__result = _GLIBCXX_MOVE(*__first2);</span>
<span id="L2658"><span class="lineNum">    2658</span>              :               ++__first2;</span>
<span id="L2659"><span class="lineNum">    2659</span>              :             }</span>
<span id="L2660"><span class="lineNum">    2660</span>              :           else</span>
<span id="L2661"><span class="lineNum">    2661</span>              :             {</span>
<span id="L2662"><span class="lineNum">    2662</span>              :               *__result = _GLIBCXX_MOVE(*__first1);</span>
<span id="L2663"><span class="lineNum">    2663</span>              :               ++__first1;</span>
<span id="L2664"><span class="lineNum">    2664</span>              :             }</span>
<span id="L2665"><span class="lineNum">    2665</span>              :           ++__result;</span>
<span id="L2666"><span class="lineNum">    2666</span>              :         }</span>
<span id="L2667"><span class="lineNum">    2667</span>              :       return _GLIBCXX_MOVE3(__first2, __last2,</span>
<span id="L2668"><span class="lineNum">    2668</span>              :                             _GLIBCXX_MOVE3(__first1, __last1,</span>
<span id="L2669"><span class="lineNum">    2669</span>              :                                            __result));</span>
<span id="L2670"><span class="lineNum">    2670</span>              :     }</span>
<span id="L2671"><span class="lineNum">    2671</span>              : </span>
<span id="L2672"><span class="lineNum">    2672</span>              :   template&lt;typename _RandomAccessIterator1, typename _RandomAccessIterator2,</span>
<span id="L2673"><span class="lineNum">    2673</span>              :            typename _Distance, typename _Compare&gt;</span>
<span id="L2674"><span class="lineNum">    2674</span>              :     void</span>
<span id="L2675"><span class="lineNum">    2675</span>              :     __merge_sort_loop(_RandomAccessIterator1 __first,</span>
<span id="L2676"><span class="lineNum">    2676</span>              :                       _RandomAccessIterator1 __last,</span>
<span id="L2677"><span class="lineNum">    2677</span>              :                       _RandomAccessIterator2 __result, _Distance __step_size,</span>
<span id="L2678"><span class="lineNum">    2678</span>              :                       _Compare __comp)</span>
<span id="L2679"><span class="lineNum">    2679</span>              :     {</span>
<span id="L2680"><span class="lineNum">    2680</span>              :       const _Distance __two_step = 2 * __step_size;</span>
<span id="L2681"><span class="lineNum">    2681</span>              : </span>
<span id="L2682"><span class="lineNum">    2682</span>              :       while (__last - __first &gt;= __two_step)</span>
<span id="L2683"><span class="lineNum">    2683</span>              :         {</span>
<span id="L2684"><span class="lineNum">    2684</span>              :           __result = std::__move_merge(__first, __first + __step_size,</span>
<span id="L2685"><span class="lineNum">    2685</span>              :                                        __first + __step_size,</span>
<span id="L2686"><span class="lineNum">    2686</span>              :                                        __first + __two_step,</span>
<span id="L2687"><span class="lineNum">    2687</span>              :                                        __result, __comp);</span>
<span id="L2688"><span class="lineNum">    2688</span>              :           __first += __two_step;</span>
<span id="L2689"><span class="lineNum">    2689</span>              :         }</span>
<span id="L2690"><span class="lineNum">    2690</span>              :       __step_size = std::min(_Distance(__last - __first), __step_size);</span>
<span id="L2691"><span class="lineNum">    2691</span>              : </span>
<span id="L2692"><span class="lineNum">    2692</span>              :       std::__move_merge(__first, __first + __step_size,</span>
<span id="L2693"><span class="lineNum">    2693</span>              :                         __first + __step_size, __last, __result, __comp);</span>
<span id="L2694"><span class="lineNum">    2694</span>              :     }</span>
<span id="L2695"><span class="lineNum">    2695</span>              : </span>
<span id="L2696"><span class="lineNum">    2696</span>              :   template&lt;typename _RandomAccessIterator, typename _Distance,</span>
<span id="L2697"><span class="lineNum">    2697</span>              :            typename _Compare&gt;</span>
<span id="L2698"><span class="lineNum">    2698</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2699"><span class="lineNum">    2699</span>              :     void</span>
<span id="L2700"><span class="lineNum">    2700</span>              :     __chunk_insertion_sort(_RandomAccessIterator __first,</span>
<span id="L2701"><span class="lineNum">    2701</span>              :                            _RandomAccessIterator __last,</span>
<span id="L2702"><span class="lineNum">    2702</span>              :                            _Distance __chunk_size, _Compare __comp)</span>
<span id="L2703"><span class="lineNum">    2703</span>              :     {</span>
<span id="L2704"><span class="lineNum">    2704</span>              :       while (__last - __first &gt;= __chunk_size)</span>
<span id="L2705"><span class="lineNum">    2705</span>              :         {</span>
<span id="L2706"><span class="lineNum">    2706</span>              :           std::__insertion_sort(__first, __first + __chunk_size, __comp);</span>
<span id="L2707"><span class="lineNum">    2707</span>              :           __first += __chunk_size;</span>
<span id="L2708"><span class="lineNum">    2708</span>              :         }</span>
<span id="L2709"><span class="lineNum">    2709</span>              :       std::__insertion_sort(__first, __last, __comp);</span>
<span id="L2710"><span class="lineNum">    2710</span>              :     }</span>
<span id="L2711"><span class="lineNum">    2711</span>              : </span>
<span id="L2712"><span class="lineNum">    2712</span>              :   enum { _S_chunk_size = 7 };</span>
<span id="L2713"><span class="lineNum">    2713</span>              : </span>
<span id="L2714"><span class="lineNum">    2714</span>              :   template&lt;typename _RandomAccessIterator, typename _Pointer, typename _Compare&gt;</span>
<span id="L2715"><span class="lineNum">    2715</span>              :     void</span>
<span id="L2716"><span class="lineNum">    2716</span>              :     __merge_sort_with_buffer(_RandomAccessIterator __first,</span>
<span id="L2717"><span class="lineNum">    2717</span>              :                              _RandomAccessIterator __last,</span>
<span id="L2718"><span class="lineNum">    2718</span>              :                              _Pointer __buffer, _Compare __comp)</span>
<span id="L2719"><span class="lineNum">    2719</span>              :     {</span>
<span id="L2720"><span class="lineNum">    2720</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::difference_type</span>
<span id="L2721"><span class="lineNum">    2721</span>              :         _Distance;</span>
<span id="L2722"><span class="lineNum">    2722</span>              : </span>
<span id="L2723"><span class="lineNum">    2723</span>              :       const _Distance __len = __last - __first;</span>
<span id="L2724"><span class="lineNum">    2724</span>              :       const _Pointer __buffer_last = __buffer + __len;</span>
<span id="L2725"><span class="lineNum">    2725</span>              : </span>
<span id="L2726"><span class="lineNum">    2726</span>              :       _Distance __step_size = _S_chunk_size;</span>
<span id="L2727"><span class="lineNum">    2727</span>              :       std::__chunk_insertion_sort(__first, __last, __step_size, __comp);</span>
<span id="L2728"><span class="lineNum">    2728</span>              : </span>
<span id="L2729"><span class="lineNum">    2729</span>              :       while (__step_size &lt; __len)</span>
<span id="L2730"><span class="lineNum">    2730</span>              :         {</span>
<span id="L2731"><span class="lineNum">    2731</span>              :           std::__merge_sort_loop(__first, __last, __buffer,</span>
<span id="L2732"><span class="lineNum">    2732</span>              :                                  __step_size, __comp);</span>
<span id="L2733"><span class="lineNum">    2733</span>              :           __step_size *= 2;</span>
<span id="L2734"><span class="lineNum">    2734</span>              :           std::__merge_sort_loop(__buffer, __buffer_last, __first,</span>
<span id="L2735"><span class="lineNum">    2735</span>              :                                  __step_size, __comp);</span>
<span id="L2736"><span class="lineNum">    2736</span>              :           __step_size *= 2;</span>
<span id="L2737"><span class="lineNum">    2737</span>              :         }</span>
<span id="L2738"><span class="lineNum">    2738</span>              :     }</span>
<span id="L2739"><span class="lineNum">    2739</span>              : </span>
<span id="L2740"><span class="lineNum">    2740</span>              :   template&lt;typename _RandomAccessIterator, typename _Pointer, typename _Compare&gt;</span>
<span id="L2741"><span class="lineNum">    2741</span>              :     void</span>
<span id="L2742"><span class="lineNum">    2742</span>              :     __stable_sort_adaptive(_RandomAccessIterator __first,</span>
<span id="L2743"><span class="lineNum">    2743</span>              :                            _RandomAccessIterator __middle,</span>
<span id="L2744"><span class="lineNum">    2744</span>              :                            _RandomAccessIterator __last,</span>
<span id="L2745"><span class="lineNum">    2745</span>              :                            _Pointer __buffer, _Compare __comp)</span>
<span id="L2746"><span class="lineNum">    2746</span>              :     {</span>
<span id="L2747"><span class="lineNum">    2747</span>              :       std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);</span>
<span id="L2748"><span class="lineNum">    2748</span>              :       std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);</span>
<span id="L2749"><span class="lineNum">    2749</span>              : </span>
<span id="L2750"><span class="lineNum">    2750</span>              :       std::__merge_adaptive(__first, __middle, __last,</span>
<span id="L2751"><span class="lineNum">    2751</span>              :                             __middle - __first, __last - __middle,</span>
<span id="L2752"><span class="lineNum">    2752</span>              :                             __buffer, __comp);</span>
<span id="L2753"><span class="lineNum">    2753</span>              :     }</span>
<span id="L2754"><span class="lineNum">    2754</span>              : </span>
<span id="L2755"><span class="lineNum">    2755</span>              :   template&lt;typename _RandomAccessIterator, typename _Pointer,</span>
<span id="L2756"><span class="lineNum">    2756</span>              :            typename _Distance, typename _Compare&gt;</span>
<span id="L2757"><span class="lineNum">    2757</span>              :     void</span>
<span id="L2758"><span class="lineNum">    2758</span>              :     __stable_sort_adaptive_resize(_RandomAccessIterator __first,</span>
<span id="L2759"><span class="lineNum">    2759</span>              :                                   _RandomAccessIterator __last,</span>
<span id="L2760"><span class="lineNum">    2760</span>              :                                   _Pointer __buffer, _Distance __buffer_size,</span>
<span id="L2761"><span class="lineNum">    2761</span>              :                                   _Compare __comp)</span>
<span id="L2762"><span class="lineNum">    2762</span>              :     {</span>
<span id="L2763"><span class="lineNum">    2763</span>              :       const _Distance __len = (__last - __first + 1) / 2;</span>
<span id="L2764"><span class="lineNum">    2764</span>              :       const _RandomAccessIterator __middle = __first + __len;</span>
<span id="L2765"><span class="lineNum">    2765</span>              :       if (__len &gt; __buffer_size)</span>
<span id="L2766"><span class="lineNum">    2766</span>              :         {</span>
<span id="L2767"><span class="lineNum">    2767</span>              :           std::__stable_sort_adaptive_resize(__first, __middle, __buffer,</span>
<span id="L2768"><span class="lineNum">    2768</span>              :                                              __buffer_size, __comp);</span>
<span id="L2769"><span class="lineNum">    2769</span>              :           std::__stable_sort_adaptive_resize(__middle, __last, __buffer,</span>
<span id="L2770"><span class="lineNum">    2770</span>              :                                              __buffer_size, __comp);</span>
<span id="L2771"><span class="lineNum">    2771</span>              :           std::__merge_adaptive_resize(__first, __middle, __last,</span>
<span id="L2772"><span class="lineNum">    2772</span>              :                                        _Distance(__middle - __first),</span>
<span id="L2773"><span class="lineNum">    2773</span>              :                                        _Distance(__last - __middle),</span>
<span id="L2774"><span class="lineNum">    2774</span>              :                                        __buffer, __buffer_size,</span>
<span id="L2775"><span class="lineNum">    2775</span>              :                                        __comp);</span>
<span id="L2776"><span class="lineNum">    2776</span>              :         }</span>
<span id="L2777"><span class="lineNum">    2777</span>              :       else</span>
<span id="L2778"><span class="lineNum">    2778</span>              :         std::__stable_sort_adaptive(__first, __middle, __last,</span>
<span id="L2779"><span class="lineNum">    2779</span>              :                                     __buffer, __comp);</span>
<span id="L2780"><span class="lineNum">    2780</span>              :     }</span>
<span id="L2781"><span class="lineNum">    2781</span>              : </span>
<span id="L2782"><span class="lineNum">    2782</span>              :   /// This is a helper function for the stable sorting routines.</span>
<span id="L2783"><span class="lineNum">    2783</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L2784"><span class="lineNum">    2784</span>              :     void</span>
<span id="L2785"><span class="lineNum">    2785</span>              :     __inplace_stable_sort(_RandomAccessIterator __first,</span>
<span id="L2786"><span class="lineNum">    2786</span>              :                           _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L2787"><span class="lineNum">    2787</span>              :     {</span>
<span id="L2788"><span class="lineNum">    2788</span>              :       if (__last - __first &lt; 15)</span>
<span id="L2789"><span class="lineNum">    2789</span>              :         {</span>
<span id="L2790"><span class="lineNum">    2790</span>              :           std::__insertion_sort(__first, __last, __comp);</span>
<span id="L2791"><span class="lineNum">    2791</span>              :           return;</span>
<span id="L2792"><span class="lineNum">    2792</span>              :         }</span>
<span id="L2793"><span class="lineNum">    2793</span>              :       _RandomAccessIterator __middle = __first + (__last - __first) / 2;</span>
<span id="L2794"><span class="lineNum">    2794</span>              :       std::__inplace_stable_sort(__first, __middle, __comp);</span>
<span id="L2795"><span class="lineNum">    2795</span>              :       std::__inplace_stable_sort(__middle, __last, __comp);</span>
<span id="L2796"><span class="lineNum">    2796</span>              :       std::__merge_without_buffer(__first, __middle, __last,</span>
<span id="L2797"><span class="lineNum">    2797</span>              :                                   __middle - __first,</span>
<span id="L2798"><span class="lineNum">    2798</span>              :                                   __last - __middle,</span>
<span id="L2799"><span class="lineNum">    2799</span>              :                                   __comp);</span>
<span id="L2800"><span class="lineNum">    2800</span>              :     }</span>
<span id="L2801"><span class="lineNum">    2801</span>              : </span>
<span id="L2802"><span class="lineNum">    2802</span>              :   // stable_sort</span>
<span id="L2803"><span class="lineNum">    2803</span>              : </span>
<span id="L2804"><span class="lineNum">    2804</span>              :   // Set algorithms: includes, set_union, set_intersection, set_difference,</span>
<span id="L2805"><span class="lineNum">    2805</span>              :   // set_symmetric_difference.  All of these algorithms have the precondition</span>
<span id="L2806"><span class="lineNum">    2806</span>              :   // that their input ranges are sorted and the postcondition that their output</span>
<span id="L2807"><span class="lineNum">    2807</span>              :   // ranges are sorted.</span>
<span id="L2808"><span class="lineNum">    2808</span>              : </span>
<span id="L2809"><span class="lineNum">    2809</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L2810"><span class="lineNum">    2810</span>              :            typename _Compare&gt;</span>
<span id="L2811"><span class="lineNum">    2811</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2812"><span class="lineNum">    2812</span>              :     bool</span>
<span id="L2813"><span class="lineNum">    2813</span>              :     __includes(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L2814"><span class="lineNum">    2814</span>              :                _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L2815"><span class="lineNum">    2815</span>              :                _Compare __comp)</span>
<span id="L2816"><span class="lineNum">    2816</span>              :     {</span>
<span id="L2817"><span class="lineNum">    2817</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L2818"><span class="lineNum">    2818</span>              :         {</span>
<span id="L2819"><span class="lineNum">    2819</span>              :           if (__comp(__first2, __first1))</span>
<span id="L2820"><span class="lineNum">    2820</span>              :             return false;</span>
<span id="L2821"><span class="lineNum">    2821</span>              :           if (!__comp(__first1, __first2))</span>
<span id="L2822"><span class="lineNum">    2822</span>              :             ++__first2;</span>
<span id="L2823"><span class="lineNum">    2823</span>              :           ++__first1;</span>
<span id="L2824"><span class="lineNum">    2824</span>              :         }</span>
<span id="L2825"><span class="lineNum">    2825</span>              : </span>
<span id="L2826"><span class="lineNum">    2826</span>              :       return __first2 == __last2;</span>
<span id="L2827"><span class="lineNum">    2827</span>              :     }</span>
<span id="L2828"><span class="lineNum">    2828</span>              : </span>
<span id="L2829"><span class="lineNum">    2829</span>              :   /**</span>
<span id="L2830"><span class="lineNum">    2830</span>              :    *  @brief Determines whether all elements of a sequence exists in a range.</span>
<span id="L2831"><span class="lineNum">    2831</span>              :    *  @param  __first1  Start of search range.</span>
<span id="L2832"><span class="lineNum">    2832</span>              :    *  @param  __last1   End of search range.</span>
<span id="L2833"><span class="lineNum">    2833</span>              :    *  @param  __first2  Start of sequence</span>
<span id="L2834"><span class="lineNum">    2834</span>              :    *  @param  __last2   End of sequence.</span>
<span id="L2835"><span class="lineNum">    2835</span>              :    *  @return  True if each element in [__first2,__last2) is contained in order</span>
<span id="L2836"><span class="lineNum">    2836</span>              :    *  within [__first1,__last1).  False otherwise.</span>
<span id="L2837"><span class="lineNum">    2837</span>              :    *  @ingroup set_algorithms</span>
<span id="L2838"><span class="lineNum">    2838</span>              :    *</span>
<span id="L2839"><span class="lineNum">    2839</span>              :    *  This operation expects both [__first1,__last1) and</span>
<span id="L2840"><span class="lineNum">    2840</span>              :    *  [__first2,__last2) to be sorted.  Searches for the presence of</span>
<span id="L2841"><span class="lineNum">    2841</span>              :    *  each element in [__first2,__last2) within [__first1,__last1).</span>
<span id="L2842"><span class="lineNum">    2842</span>              :    *  The iterators over each range only move forward, so this is a</span>
<span id="L2843"><span class="lineNum">    2843</span>              :    *  linear algorithm.  If an element in [__first2,__last2) is not</span>
<span id="L2844"><span class="lineNum">    2844</span>              :    *  found before the search iterator reaches @p __last2, false is</span>
<span id="L2845"><span class="lineNum">    2845</span>              :    *  returned.</span>
<span id="L2846"><span class="lineNum">    2846</span>              :   */</span>
<span id="L2847"><span class="lineNum">    2847</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2&gt;</span>
<span id="L2848"><span class="lineNum">    2848</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2849"><span class="lineNum">    2849</span>              :     inline bool</span>
<span id="L2850"><span class="lineNum">    2850</span>              :     includes(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L2851"><span class="lineNum">    2851</span>              :              _InputIterator2 __first2, _InputIterator2 __last2)</span>
<span id="L2852"><span class="lineNum">    2852</span>              :     {</span>
<span id="L2853"><span class="lineNum">    2853</span>              :       // concept requirements</span>
<span id="L2854"><span class="lineNum">    2854</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L2855"><span class="lineNum">    2855</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L2856"><span class="lineNum">    2856</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2857"><span class="lineNum">    2857</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L2858"><span class="lineNum">    2858</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L2859"><span class="lineNum">    2859</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L2860"><span class="lineNum">    2860</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L2861"><span class="lineNum">    2861</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L2862"><span class="lineNum">    2862</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L2863"><span class="lineNum">    2863</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L2864"><span class="lineNum">    2864</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L2865"><span class="lineNum">    2865</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L2866"><span class="lineNum">    2866</span>              : </span>
<span id="L2867"><span class="lineNum">    2867</span>              :       return std::__includes(__first1, __last1, __first2, __last2,</span>
<span id="L2868"><span class="lineNum">    2868</span>              :                              __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L2869"><span class="lineNum">    2869</span>              :     }</span>
<span id="L2870"><span class="lineNum">    2870</span>              : </span>
<span id="L2871"><span class="lineNum">    2871</span>              :   /**</span>
<span id="L2872"><span class="lineNum">    2872</span>              :    *  @brief Determines whether all elements of a sequence exists in a range</span>
<span id="L2873"><span class="lineNum">    2873</span>              :    *  using comparison.</span>
<span id="L2874"><span class="lineNum">    2874</span>              :    *  @ingroup set_algorithms</span>
<span id="L2875"><span class="lineNum">    2875</span>              :    *  @param  __first1  Start of search range.</span>
<span id="L2876"><span class="lineNum">    2876</span>              :    *  @param  __last1   End of search range.</span>
<span id="L2877"><span class="lineNum">    2877</span>              :    *  @param  __first2  Start of sequence</span>
<span id="L2878"><span class="lineNum">    2878</span>              :    *  @param  __last2   End of sequence.</span>
<span id="L2879"><span class="lineNum">    2879</span>              :    *  @param  __comp    Comparison function to use.</span>
<span id="L2880"><span class="lineNum">    2880</span>              :    *  @return True if each element in [__first2,__last2) is contained</span>
<span id="L2881"><span class="lineNum">    2881</span>              :    *  in order within [__first1,__last1) according to comp.  False</span>
<span id="L2882"><span class="lineNum">    2882</span>              :    *  otherwise.  @ingroup set_algorithms</span>
<span id="L2883"><span class="lineNum">    2883</span>              :    *</span>
<span id="L2884"><span class="lineNum">    2884</span>              :    *  This operation expects both [__first1,__last1) and</span>
<span id="L2885"><span class="lineNum">    2885</span>              :    *  [__first2,__last2) to be sorted.  Searches for the presence of</span>
<span id="L2886"><span class="lineNum">    2886</span>              :    *  each element in [__first2,__last2) within [__first1,__last1),</span>
<span id="L2887"><span class="lineNum">    2887</span>              :    *  using comp to decide.  The iterators over each range only move</span>
<span id="L2888"><span class="lineNum">    2888</span>              :    *  forward, so this is a linear algorithm.  If an element in</span>
<span id="L2889"><span class="lineNum">    2889</span>              :    *  [__first2,__last2) is not found before the search iterator</span>
<span id="L2890"><span class="lineNum">    2890</span>              :    *  reaches @p __last2, false is returned.</span>
<span id="L2891"><span class="lineNum">    2891</span>              :   */</span>
<span id="L2892"><span class="lineNum">    2892</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L2893"><span class="lineNum">    2893</span>              :            typename _Compare&gt;</span>
<span id="L2894"><span class="lineNum">    2894</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2895"><span class="lineNum">    2895</span>              :     inline bool</span>
<span id="L2896"><span class="lineNum">    2896</span>              :     includes(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L2897"><span class="lineNum">    2897</span>              :              _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L2898"><span class="lineNum">    2898</span>              :              _Compare __comp)</span>
<span id="L2899"><span class="lineNum">    2899</span>              :     {</span>
<span id="L2900"><span class="lineNum">    2900</span>              :       // concept requirements</span>
<span id="L2901"><span class="lineNum">    2901</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L2902"><span class="lineNum">    2902</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L2903"><span class="lineNum">    2903</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2904"><span class="lineNum">    2904</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L2905"><span class="lineNum">    2905</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L2906"><span class="lineNum">    2906</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L2907"><span class="lineNum">    2907</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L2908"><span class="lineNum">    2908</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L2909"><span class="lineNum">    2909</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L2910"><span class="lineNum">    2910</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L2911"><span class="lineNum">    2911</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L2912"><span class="lineNum">    2912</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L2913"><span class="lineNum">    2913</span>              : </span>
<span id="L2914"><span class="lineNum">    2914</span>              :       return std::__includes(__first1, __last1, __first2, __last2,</span>
<span id="L2915"><span class="lineNum">    2915</span>              :                              __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L2916"><span class="lineNum">    2916</span>              :     }</span>
<span id="L2917"><span class="lineNum">    2917</span>              : </span>
<span id="L2918"><span class="lineNum">    2918</span>              :   // nth_element</span>
<span id="L2919"><span class="lineNum">    2919</span>              :   // merge</span>
<span id="L2920"><span class="lineNum">    2920</span>              :   // set_difference</span>
<span id="L2921"><span class="lineNum">    2921</span>              :   // set_intersection</span>
<span id="L2922"><span class="lineNum">    2922</span>              :   // set_union</span>
<span id="L2923"><span class="lineNum">    2923</span>              :   // stable_sort</span>
<span id="L2924"><span class="lineNum">    2924</span>              :   // set_symmetric_difference</span>
<span id="L2925"><span class="lineNum">    2925</span>              :   // min_element</span>
<span id="L2926"><span class="lineNum">    2926</span>              :   // max_element</span>
<span id="L2927"><span class="lineNum">    2927</span>              : </span>
<span id="L2928"><span class="lineNum">    2928</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L2929"><span class="lineNum">    2929</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2930"><span class="lineNum">    2930</span>              :     bool</span>
<span id="L2931"><span class="lineNum">    2931</span>              :     __next_permutation(_BidirectionalIterator __first,</span>
<span id="L2932"><span class="lineNum">    2932</span>              :                        _BidirectionalIterator __last, _Compare __comp)</span>
<span id="L2933"><span class="lineNum">    2933</span>              :     {</span>
<span id="L2934"><span class="lineNum">    2934</span>              :       if (__first == __last)</span>
<span id="L2935"><span class="lineNum">    2935</span>              :         return false;</span>
<span id="L2936"><span class="lineNum">    2936</span>              :       _BidirectionalIterator __i = __first;</span>
<span id="L2937"><span class="lineNum">    2937</span>              :       ++__i;</span>
<span id="L2938"><span class="lineNum">    2938</span>              :       if (__i == __last)</span>
<span id="L2939"><span class="lineNum">    2939</span>              :         return false;</span>
<span id="L2940"><span class="lineNum">    2940</span>              :       __i = __last;</span>
<span id="L2941"><span class="lineNum">    2941</span>              :       --__i;</span>
<span id="L2942"><span class="lineNum">    2942</span>              : </span>
<span id="L2943"><span class="lineNum">    2943</span>              :       for(;;)</span>
<span id="L2944"><span class="lineNum">    2944</span>              :         {</span>
<span id="L2945"><span class="lineNum">    2945</span>              :           _BidirectionalIterator __ii = __i;</span>
<span id="L2946"><span class="lineNum">    2946</span>              :           --__i;</span>
<span id="L2947"><span class="lineNum">    2947</span>              :           if (__comp(__i, __ii))</span>
<span id="L2948"><span class="lineNum">    2948</span>              :             {</span>
<span id="L2949"><span class="lineNum">    2949</span>              :               _BidirectionalIterator __j = __last;</span>
<span id="L2950"><span class="lineNum">    2950</span>              :               while (!__comp(__i, --__j))</span>
<span id="L2951"><span class="lineNum">    2951</span>              :                 {}</span>
<span id="L2952"><span class="lineNum">    2952</span>              :               std::iter_swap(__i, __j);</span>
<span id="L2953"><span class="lineNum">    2953</span>              :               std::__reverse(__ii, __last,</span>
<span id="L2954"><span class="lineNum">    2954</span>              :                              std::__iterator_category(__first));</span>
<span id="L2955"><span class="lineNum">    2955</span>              :               return true;</span>
<span id="L2956"><span class="lineNum">    2956</span>              :             }</span>
<span id="L2957"><span class="lineNum">    2957</span>              :           if (__i == __first)</span>
<span id="L2958"><span class="lineNum">    2958</span>              :             {</span>
<span id="L2959"><span class="lineNum">    2959</span>              :               std::__reverse(__first, __last,</span>
<span id="L2960"><span class="lineNum">    2960</span>              :                              std::__iterator_category(__first));</span>
<span id="L2961"><span class="lineNum">    2961</span>              :               return false;</span>
<span id="L2962"><span class="lineNum">    2962</span>              :             }</span>
<span id="L2963"><span class="lineNum">    2963</span>              :         }</span>
<span id="L2964"><span class="lineNum">    2964</span>              :     }</span>
<span id="L2965"><span class="lineNum">    2965</span>              : </span>
<span id="L2966"><span class="lineNum">    2966</span>              :   /**</span>
<span id="L2967"><span class="lineNum">    2967</span>              :    *  @brief  Permute range into the next @e dictionary ordering.</span>
<span id="L2968"><span class="lineNum">    2968</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L2969"><span class="lineNum">    2969</span>              :    *  @param  __first  Start of range.</span>
<span id="L2970"><span class="lineNum">    2970</span>              :    *  @param  __last   End of range.</span>
<span id="L2971"><span class="lineNum">    2971</span>              :    *  @return  False if wrapped to first permutation, true otherwise.</span>
<span id="L2972"><span class="lineNum">    2972</span>              :    *</span>
<span id="L2973"><span class="lineNum">    2973</span>              :    *  Treats all permutations of the range as a set of @e dictionary sorted</span>
<span id="L2974"><span class="lineNum">    2974</span>              :    *  sequences.  Permutes the current sequence into the next one of this set.</span>
<span id="L2975"><span class="lineNum">    2975</span>              :    *  Returns true if there are more sequences to generate.  If the sequence</span>
<span id="L2976"><span class="lineNum">    2976</span>              :    *  is the largest of the set, the smallest is generated and false returned.</span>
<span id="L2977"><span class="lineNum">    2977</span>              :   */</span>
<span id="L2978"><span class="lineNum">    2978</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L2979"><span class="lineNum">    2979</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L2980"><span class="lineNum">    2980</span>              :     inline bool</span>
<span id="L2981"><span class="lineNum">    2981</span>              :     next_permutation(_BidirectionalIterator __first,</span>
<span id="L2982"><span class="lineNum">    2982</span>              :                      _BidirectionalIterator __last)</span>
<span id="L2983"><span class="lineNum">    2983</span>              :     {</span>
<span id="L2984"><span class="lineNum">    2984</span>              :       // concept requirements</span>
<span id="L2985"><span class="lineNum">    2985</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L2986"><span class="lineNum">    2986</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L2987"><span class="lineNum">    2987</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L2988"><span class="lineNum">    2988</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L2989"><span class="lineNum">    2989</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L2990"><span class="lineNum">    2990</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L2991"><span class="lineNum">    2991</span>              : </span>
<span id="L2992"><span class="lineNum">    2992</span>              :       return std::__next_permutation</span>
<span id="L2993"><span class="lineNum">    2993</span>              :         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L2994"><span class="lineNum">    2994</span>              :     }</span>
<span id="L2995"><span class="lineNum">    2995</span>              : </span>
<span id="L2996"><span class="lineNum">    2996</span>              :   /**</span>
<span id="L2997"><span class="lineNum">    2997</span>              :    *  @brief  Permute range into the next @e dictionary ordering using</span>
<span id="L2998"><span class="lineNum">    2998</span>              :    *          comparison functor.</span>
<span id="L2999"><span class="lineNum">    2999</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3000"><span class="lineNum">    3000</span>              :    *  @param  __first  Start of range.</span>
<span id="L3001"><span class="lineNum">    3001</span>              :    *  @param  __last   End of range.</span>
<span id="L3002"><span class="lineNum">    3002</span>              :    *  @param  __comp   A comparison functor.</span>
<span id="L3003"><span class="lineNum">    3003</span>              :    *  @return  False if wrapped to first permutation, true otherwise.</span>
<span id="L3004"><span class="lineNum">    3004</span>              :    *</span>
<span id="L3005"><span class="lineNum">    3005</span>              :    *  Treats all permutations of the range [__first,__last) as a set of</span>
<span id="L3006"><span class="lineNum">    3006</span>              :    *  @e dictionary sorted sequences ordered by @p __comp.  Permutes the current</span>
<span id="L3007"><span class="lineNum">    3007</span>              :    *  sequence into the next one of this set.  Returns true if there are more</span>
<span id="L3008"><span class="lineNum">    3008</span>              :    *  sequences to generate.  If the sequence is the largest of the set, the</span>
<span id="L3009"><span class="lineNum">    3009</span>              :    *  smallest is generated and false returned.</span>
<span id="L3010"><span class="lineNum">    3010</span>              :   */</span>
<span id="L3011"><span class="lineNum">    3011</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L3012"><span class="lineNum">    3012</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3013"><span class="lineNum">    3013</span>              :     inline bool</span>
<span id="L3014"><span class="lineNum">    3014</span>              :     next_permutation(_BidirectionalIterator __first,</span>
<span id="L3015"><span class="lineNum">    3015</span>              :                      _BidirectionalIterator __last, _Compare __comp)</span>
<span id="L3016"><span class="lineNum">    3016</span>              :     {</span>
<span id="L3017"><span class="lineNum">    3017</span>              :       // concept requirements</span>
<span id="L3018"><span class="lineNum">    3018</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L3019"><span class="lineNum">    3019</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L3020"><span class="lineNum">    3020</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L3021"><span class="lineNum">    3021</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type,</span>
<span id="L3022"><span class="lineNum">    3022</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L3023"><span class="lineNum">    3023</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3024"><span class="lineNum">    3024</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L3025"><span class="lineNum">    3025</span>              : </span>
<span id="L3026"><span class="lineNum">    3026</span>              :       return std::__next_permutation</span>
<span id="L3027"><span class="lineNum">    3027</span>              :         (__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L3028"><span class="lineNum">    3028</span>              :     }</span>
<span id="L3029"><span class="lineNum">    3029</span>              : </span>
<span id="L3030"><span class="lineNum">    3030</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L3031"><span class="lineNum">    3031</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3032"><span class="lineNum">    3032</span>              :     bool</span>
<span id="L3033"><span class="lineNum">    3033</span>              :     __prev_permutation(_BidirectionalIterator __first,</span>
<span id="L3034"><span class="lineNum">    3034</span>              :                        _BidirectionalIterator __last, _Compare __comp)</span>
<span id="L3035"><span class="lineNum">    3035</span>              :     {</span>
<span id="L3036"><span class="lineNum">    3036</span>              :       if (__first == __last)</span>
<span id="L3037"><span class="lineNum">    3037</span>              :         return false;</span>
<span id="L3038"><span class="lineNum">    3038</span>              :       _BidirectionalIterator __i = __first;</span>
<span id="L3039"><span class="lineNum">    3039</span>              :       ++__i;</span>
<span id="L3040"><span class="lineNum">    3040</span>              :       if (__i == __last)</span>
<span id="L3041"><span class="lineNum">    3041</span>              :         return false;</span>
<span id="L3042"><span class="lineNum">    3042</span>              :       __i = __last;</span>
<span id="L3043"><span class="lineNum">    3043</span>              :       --__i;</span>
<span id="L3044"><span class="lineNum">    3044</span>              : </span>
<span id="L3045"><span class="lineNum">    3045</span>              :       for(;;)</span>
<span id="L3046"><span class="lineNum">    3046</span>              :         {</span>
<span id="L3047"><span class="lineNum">    3047</span>              :           _BidirectionalIterator __ii = __i;</span>
<span id="L3048"><span class="lineNum">    3048</span>              :           --__i;</span>
<span id="L3049"><span class="lineNum">    3049</span>              :           if (__comp(__ii, __i))</span>
<span id="L3050"><span class="lineNum">    3050</span>              :             {</span>
<span id="L3051"><span class="lineNum">    3051</span>              :               _BidirectionalIterator __j = __last;</span>
<span id="L3052"><span class="lineNum">    3052</span>              :               while (!__comp(--__j, __i))</span>
<span id="L3053"><span class="lineNum">    3053</span>              :                 {}</span>
<span id="L3054"><span class="lineNum">    3054</span>              :               std::iter_swap(__i, __j);</span>
<span id="L3055"><span class="lineNum">    3055</span>              :               std::__reverse(__ii, __last,</span>
<span id="L3056"><span class="lineNum">    3056</span>              :                              std::__iterator_category(__first));</span>
<span id="L3057"><span class="lineNum">    3057</span>              :               return true;</span>
<span id="L3058"><span class="lineNum">    3058</span>              :             }</span>
<span id="L3059"><span class="lineNum">    3059</span>              :           if (__i == __first)</span>
<span id="L3060"><span class="lineNum">    3060</span>              :             {</span>
<span id="L3061"><span class="lineNum">    3061</span>              :               std::__reverse(__first, __last,</span>
<span id="L3062"><span class="lineNum">    3062</span>              :                              std::__iterator_category(__first));</span>
<span id="L3063"><span class="lineNum">    3063</span>              :               return false;</span>
<span id="L3064"><span class="lineNum">    3064</span>              :             }</span>
<span id="L3065"><span class="lineNum">    3065</span>              :         }</span>
<span id="L3066"><span class="lineNum">    3066</span>              :     }</span>
<span id="L3067"><span class="lineNum">    3067</span>              : </span>
<span id="L3068"><span class="lineNum">    3068</span>              :   /**</span>
<span id="L3069"><span class="lineNum">    3069</span>              :    *  @brief  Permute range into the previous @e dictionary ordering.</span>
<span id="L3070"><span class="lineNum">    3070</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3071"><span class="lineNum">    3071</span>              :    *  @param  __first  Start of range.</span>
<span id="L3072"><span class="lineNum">    3072</span>              :    *  @param  __last   End of range.</span>
<span id="L3073"><span class="lineNum">    3073</span>              :    *  @return  False if wrapped to last permutation, true otherwise.</span>
<span id="L3074"><span class="lineNum">    3074</span>              :    *</span>
<span id="L3075"><span class="lineNum">    3075</span>              :    *  Treats all permutations of the range as a set of @e dictionary sorted</span>
<span id="L3076"><span class="lineNum">    3076</span>              :    *  sequences.  Permutes the current sequence into the previous one of this</span>
<span id="L3077"><span class="lineNum">    3077</span>              :    *  set.  Returns true if there are more sequences to generate.  If the</span>
<span id="L3078"><span class="lineNum">    3078</span>              :    *  sequence is the smallest of the set, the largest is generated and false</span>
<span id="L3079"><span class="lineNum">    3079</span>              :    *  returned.</span>
<span id="L3080"><span class="lineNum">    3080</span>              :   */</span>
<span id="L3081"><span class="lineNum">    3081</span>              :   template&lt;typename _BidirectionalIterator&gt;</span>
<span id="L3082"><span class="lineNum">    3082</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3083"><span class="lineNum">    3083</span>              :     inline bool</span>
<span id="L3084"><span class="lineNum">    3084</span>              :     prev_permutation(_BidirectionalIterator __first,</span>
<span id="L3085"><span class="lineNum">    3085</span>              :                      _BidirectionalIterator __last)</span>
<span id="L3086"><span class="lineNum">    3086</span>              :     {</span>
<span id="L3087"><span class="lineNum">    3087</span>              :       // concept requirements</span>
<span id="L3088"><span class="lineNum">    3088</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L3089"><span class="lineNum">    3089</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L3090"><span class="lineNum">    3090</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L3091"><span class="lineNum">    3091</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L3092"><span class="lineNum">    3092</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3093"><span class="lineNum">    3093</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L3094"><span class="lineNum">    3094</span>              : </span>
<span id="L3095"><span class="lineNum">    3095</span>              :       return std::__prev_permutation(__first, __last,</span>
<span id="L3096"><span class="lineNum">    3096</span>              :                                      __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L3097"><span class="lineNum">    3097</span>              :     }</span>
<span id="L3098"><span class="lineNum">    3098</span>              : </span>
<span id="L3099"><span class="lineNum">    3099</span>              :   /**</span>
<span id="L3100"><span class="lineNum">    3100</span>              :    *  @brief  Permute range into the previous @e dictionary ordering using</span>
<span id="L3101"><span class="lineNum">    3101</span>              :    *          comparison functor.</span>
<span id="L3102"><span class="lineNum">    3102</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3103"><span class="lineNum">    3103</span>              :    *  @param  __first  Start of range.</span>
<span id="L3104"><span class="lineNum">    3104</span>              :    *  @param  __last   End of range.</span>
<span id="L3105"><span class="lineNum">    3105</span>              :    *  @param  __comp   A comparison functor.</span>
<span id="L3106"><span class="lineNum">    3106</span>              :    *  @return  False if wrapped to last permutation, true otherwise.</span>
<span id="L3107"><span class="lineNum">    3107</span>              :    *</span>
<span id="L3108"><span class="lineNum">    3108</span>              :    *  Treats all permutations of the range [__first,__last) as a set of</span>
<span id="L3109"><span class="lineNum">    3109</span>              :    *  @e dictionary sorted sequences ordered by @p __comp.  Permutes the current</span>
<span id="L3110"><span class="lineNum">    3110</span>              :    *  sequence into the previous one of this set.  Returns true if there are</span>
<span id="L3111"><span class="lineNum">    3111</span>              :    *  more sequences to generate.  If the sequence is the smallest of the set,</span>
<span id="L3112"><span class="lineNum">    3112</span>              :    *  the largest is generated and false returned.</span>
<span id="L3113"><span class="lineNum">    3113</span>              :   */</span>
<span id="L3114"><span class="lineNum">    3114</span>              :   template&lt;typename _BidirectionalIterator, typename _Compare&gt;</span>
<span id="L3115"><span class="lineNum">    3115</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3116"><span class="lineNum">    3116</span>              :     inline bool</span>
<span id="L3117"><span class="lineNum">    3117</span>              :     prev_permutation(_BidirectionalIterator __first,</span>
<span id="L3118"><span class="lineNum">    3118</span>              :                      _BidirectionalIterator __last, _Compare __comp)</span>
<span id="L3119"><span class="lineNum">    3119</span>              :     {</span>
<span id="L3120"><span class="lineNum">    3120</span>              :       // concept requirements</span>
<span id="L3121"><span class="lineNum">    3121</span>              :       __glibcxx_function_requires(_BidirectionalIteratorConcept&lt;</span>
<span id="L3122"><span class="lineNum">    3122</span>              :                                   _BidirectionalIterator&gt;)</span>
<span id="L3123"><span class="lineNum">    3123</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L3124"><span class="lineNum">    3124</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type,</span>
<span id="L3125"><span class="lineNum">    3125</span>              :             typename iterator_traits&lt;_BidirectionalIterator&gt;::value_type&gt;)</span>
<span id="L3126"><span class="lineNum">    3126</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3127"><span class="lineNum">    3127</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L3128"><span class="lineNum">    3128</span>              : </span>
<span id="L3129"><span class="lineNum">    3129</span>              :       return std::__prev_permutation(__first, __last,</span>
<span id="L3130"><span class="lineNum">    3130</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L3131"><span class="lineNum">    3131</span>              :     }</span>
<span id="L3132"><span class="lineNum">    3132</span>              : </span>
<span id="L3133"><span class="lineNum">    3133</span>              :   // replace</span>
<span id="L3134"><span class="lineNum">    3134</span>              :   // replace_if</span>
<span id="L3135"><span class="lineNum">    3135</span>              : </span>
<span id="L3136"><span class="lineNum">    3136</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L3137"><span class="lineNum">    3137</span>              :            typename _Predicate, typename _Tp&gt;</span>
<span id="L3138"><span class="lineNum">    3138</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3139"><span class="lineNum">    3139</span>              :     _OutputIterator</span>
<span id="L3140"><span class="lineNum">    3140</span>              :     __replace_copy_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L3141"><span class="lineNum">    3141</span>              :                       _OutputIterator __result,</span>
<span id="L3142"><span class="lineNum">    3142</span>              :                       _Predicate __pred, const _Tp&amp; __new_value)</span>
<span id="L3143"><span class="lineNum">    3143</span>              :     {</span>
<span id="L3144"><span class="lineNum">    3144</span>              :       for (; __first != __last; ++__first, (void)++__result)</span>
<span id="L3145"><span class="lineNum">    3145</span>              :         if (__pred(__first))</span>
<span id="L3146"><span class="lineNum">    3146</span>              :           *__result = __new_value;</span>
<span id="L3147"><span class="lineNum">    3147</span>              :         else</span>
<span id="L3148"><span class="lineNum">    3148</span>              :           *__result = *__first;</span>
<span id="L3149"><span class="lineNum">    3149</span>              :       return __result;</span>
<span id="L3150"><span class="lineNum">    3150</span>              :     }</span>
<span id="L3151"><span class="lineNum">    3151</span>              : </span>
<span id="L3152"><span class="lineNum">    3152</span>              :   /**</span>
<span id="L3153"><span class="lineNum">    3153</span>              :    *  @brief Copy a sequence, replacing each element of one value with another</span>
<span id="L3154"><span class="lineNum">    3154</span>              :    *         value.</span>
<span id="L3155"><span class="lineNum">    3155</span>              :    *  @param  __first      An input iterator.</span>
<span id="L3156"><span class="lineNum">    3156</span>              :    *  @param  __last       An input iterator.</span>
<span id="L3157"><span class="lineNum">    3157</span>              :    *  @param  __result     An output iterator.</span>
<span id="L3158"><span class="lineNum">    3158</span>              :    *  @param  __old_value  The value to be replaced.</span>
<span id="L3159"><span class="lineNum">    3159</span>              :    *  @param  __new_value  The replacement value.</span>
<span id="L3160"><span class="lineNum">    3160</span>              :    *  @return   The end of the output sequence, @p result+(last-first).</span>
<span id="L3161"><span class="lineNum">    3161</span>              :    *</span>
<span id="L3162"><span class="lineNum">    3162</span>              :    *  Copies each element in the input range @p [__first,__last) to the</span>
<span id="L3163"><span class="lineNum">    3163</span>              :    *  output range @p [__result,__result+(__last-__first)) replacing elements</span>
<span id="L3164"><span class="lineNum">    3164</span>              :    *  equal to @p __old_value with @p __new_value.</span>
<span id="L3165"><span class="lineNum">    3165</span>              :   */</span>
<span id="L3166"><span class="lineNum">    3166</span>              :   template&lt;typename _InputIterator, typename _OutputIterator, typename _Tp&gt;</span>
<span id="L3167"><span class="lineNum">    3167</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3168"><span class="lineNum">    3168</span>              :     inline _OutputIterator</span>
<span id="L3169"><span class="lineNum">    3169</span>              :     replace_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L3170"><span class="lineNum">    3170</span>              :                  _OutputIterator __result,</span>
<span id="L3171"><span class="lineNum">    3171</span>              :                  const _Tp&amp; __old_value, const _Tp&amp; __new_value)</span>
<span id="L3172"><span class="lineNum">    3172</span>              :     {</span>
<span id="L3173"><span class="lineNum">    3173</span>              :       // concept requirements</span>
<span id="L3174"><span class="lineNum">    3174</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3175"><span class="lineNum">    3175</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L3176"><span class="lineNum">    3176</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L3177"><span class="lineNum">    3177</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L3178"><span class="lineNum">    3178</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L3179"><span class="lineNum">    3179</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3180"><span class="lineNum">    3180</span>              : </span>
<span id="L3181"><span class="lineNum">    3181</span>              :       return std::__replace_copy_if(__first, __last, __result,</span>
<span id="L3182"><span class="lineNum">    3182</span>              :                         __gnu_cxx::__ops::__iter_equals_val(__old_value),</span>
<span id="L3183"><span class="lineNum">    3183</span>              :                                               __new_value);</span>
<span id="L3184"><span class="lineNum">    3184</span>              :     }</span>
<span id="L3185"><span class="lineNum">    3185</span>              : </span>
<span id="L3186"><span class="lineNum">    3186</span>              :   /**</span>
<span id="L3187"><span class="lineNum">    3187</span>              :    *  @brief Copy a sequence, replacing each value for which a predicate</span>
<span id="L3188"><span class="lineNum">    3188</span>              :    *         returns true with another value.</span>
<span id="L3189"><span class="lineNum">    3189</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L3190"><span class="lineNum">    3190</span>              :    *  @param  __first      An input iterator.</span>
<span id="L3191"><span class="lineNum">    3191</span>              :    *  @param  __last       An input iterator.</span>
<span id="L3192"><span class="lineNum">    3192</span>              :    *  @param  __result     An output iterator.</span>
<span id="L3193"><span class="lineNum">    3193</span>              :    *  @param  __pred       A predicate.</span>
<span id="L3194"><span class="lineNum">    3194</span>              :    *  @param  __new_value  The replacement value.</span>
<span id="L3195"><span class="lineNum">    3195</span>              :    *  @return   The end of the output sequence, @p __result+(__last-__first).</span>
<span id="L3196"><span class="lineNum">    3196</span>              :    *</span>
<span id="L3197"><span class="lineNum">    3197</span>              :    *  Copies each element in the range @p [__first,__last) to the range</span>
<span id="L3198"><span class="lineNum">    3198</span>              :    *  @p [__result,__result+(__last-__first)) replacing elements for which</span>
<span id="L3199"><span class="lineNum">    3199</span>              :    *  @p __pred returns true with @p __new_value.</span>
<span id="L3200"><span class="lineNum">    3200</span>              :   */</span>
<span id="L3201"><span class="lineNum">    3201</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L3202"><span class="lineNum">    3202</span>              :            typename _Predicate, typename _Tp&gt;</span>
<span id="L3203"><span class="lineNum">    3203</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3204"><span class="lineNum">    3204</span>              :     inline _OutputIterator</span>
<span id="L3205"><span class="lineNum">    3205</span>              :     replace_copy_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L3206"><span class="lineNum">    3206</span>              :                     _OutputIterator __result,</span>
<span id="L3207"><span class="lineNum">    3207</span>              :                     _Predicate __pred, const _Tp&amp; __new_value)</span>
<span id="L3208"><span class="lineNum">    3208</span>              :     {</span>
<span id="L3209"><span class="lineNum">    3209</span>              :       // concept requirements</span>
<span id="L3210"><span class="lineNum">    3210</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3211"><span class="lineNum">    3211</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L3212"><span class="lineNum">    3212</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L3213"><span class="lineNum">    3213</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L3214"><span class="lineNum">    3214</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L3215"><span class="lineNum">    3215</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3216"><span class="lineNum">    3216</span>              : </span>
<span id="L3217"><span class="lineNum">    3217</span>              :       return std::__replace_copy_if(__first, __last, __result,</span>
<span id="L3218"><span class="lineNum">    3218</span>              :                                 __gnu_cxx::__ops::__pred_iter(__pred),</span>
<span id="L3219"><span class="lineNum">    3219</span>              :                                               __new_value);</span>
<span id="L3220"><span class="lineNum">    3220</span>              :     }</span>
<span id="L3221"><span class="lineNum">    3221</span>              : </span>
<span id="L3222"><span class="lineNum">    3222</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L3223"><span class="lineNum">    3223</span>              :   /**</span>
<span id="L3224"><span class="lineNum">    3224</span>              :    *  @brief  Determines whether the elements of a sequence are sorted.</span>
<span id="L3225"><span class="lineNum">    3225</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3226"><span class="lineNum">    3226</span>              :    *  @param  __first   An iterator.</span>
<span id="L3227"><span class="lineNum">    3227</span>              :    *  @param  __last    Another iterator.</span>
<span id="L3228"><span class="lineNum">    3228</span>              :    *  @return  True if the elements are sorted, false otherwise.</span>
<span id="L3229"><span class="lineNum">    3229</span>              :   */</span>
<span id="L3230"><span class="lineNum">    3230</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L3231"><span class="lineNum">    3231</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3232"><span class="lineNum">    3232</span>              :     inline bool</span>
<span id="L3233"><span class="lineNum">    3233</span>              :     is_sorted(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L3234"><span class="lineNum">    3234</span>              :     { return std::is_sorted_until(__first, __last) == __last; }</span>
<span id="L3235"><span class="lineNum">    3235</span>              : </span>
<span id="L3236"><span class="lineNum">    3236</span>              :   /**</span>
<span id="L3237"><span class="lineNum">    3237</span>              :    *  @brief  Determines whether the elements of a sequence are sorted</span>
<span id="L3238"><span class="lineNum">    3238</span>              :    *          according to a comparison functor.</span>
<span id="L3239"><span class="lineNum">    3239</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3240"><span class="lineNum">    3240</span>              :    *  @param  __first   An iterator.</span>
<span id="L3241"><span class="lineNum">    3241</span>              :    *  @param  __last    Another iterator.</span>
<span id="L3242"><span class="lineNum">    3242</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L3243"><span class="lineNum">    3243</span>              :    *  @return  True if the elements are sorted, false otherwise.</span>
<span id="L3244"><span class="lineNum">    3244</span>              :   */</span>
<span id="L3245"><span class="lineNum">    3245</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L3246"><span class="lineNum">    3246</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3247"><span class="lineNum">    3247</span>              :     inline bool</span>
<span id="L3248"><span class="lineNum">    3248</span>              :     is_sorted(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L3249"><span class="lineNum">    3249</span>              :               _Compare __comp)</span>
<span id="L3250"><span class="lineNum">    3250</span>              :     { return std::is_sorted_until(__first, __last, __comp) == __last; }</span>
<span id="L3251"><span class="lineNum">    3251</span>              : </span>
<span id="L3252"><span class="lineNum">    3252</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L3253"><span class="lineNum">    3253</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3254"><span class="lineNum">    3254</span>              :     _ForwardIterator</span>
<span id="L3255"><span class="lineNum">    3255</span>              :     __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L3256"><span class="lineNum">    3256</span>              :                       _Compare __comp)</span>
<span id="L3257"><span class="lineNum">    3257</span>              :     {</span>
<span id="L3258"><span class="lineNum">    3258</span>              :       if (__first == __last)</span>
<span id="L3259"><span class="lineNum">    3259</span>              :         return __last;</span>
<span id="L3260"><span class="lineNum">    3260</span>              : </span>
<span id="L3261"><span class="lineNum">    3261</span>              :       _ForwardIterator __next = __first;</span>
<span id="L3262"><span class="lineNum">    3262</span>              :       for (++__next; __next != __last; __first = __next, (void)++__next)</span>
<span id="L3263"><span class="lineNum">    3263</span>              :         if (__comp(__next, __first))</span>
<span id="L3264"><span class="lineNum">    3264</span>              :           return __next;</span>
<span id="L3265"><span class="lineNum">    3265</span>              :       return __next;</span>
<span id="L3266"><span class="lineNum">    3266</span>              :     }</span>
<span id="L3267"><span class="lineNum">    3267</span>              : </span>
<span id="L3268"><span class="lineNum">    3268</span>              :   /**</span>
<span id="L3269"><span class="lineNum">    3269</span>              :    *  @brief  Determines the end of a sorted sequence.</span>
<span id="L3270"><span class="lineNum">    3270</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3271"><span class="lineNum">    3271</span>              :    *  @param  __first   An iterator.</span>
<span id="L3272"><span class="lineNum">    3272</span>              :    *  @param  __last    Another iterator.</span>
<span id="L3273"><span class="lineNum">    3273</span>              :    *  @return  An iterator pointing to the last iterator i in [__first, __last)</span>
<span id="L3274"><span class="lineNum">    3274</span>              :    *           for which the range [__first, i) is sorted.</span>
<span id="L3275"><span class="lineNum">    3275</span>              :   */</span>
<span id="L3276"><span class="lineNum">    3276</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L3277"><span class="lineNum">    3277</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3278"><span class="lineNum">    3278</span>              :     inline _ForwardIterator</span>
<span id="L3279"><span class="lineNum">    3279</span>              :     is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L3280"><span class="lineNum">    3280</span>              :     {</span>
<span id="L3281"><span class="lineNum">    3281</span>              :       // concept requirements</span>
<span id="L3282"><span class="lineNum">    3282</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3283"><span class="lineNum">    3283</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L3284"><span class="lineNum">    3284</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3285"><span class="lineNum">    3285</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3286"><span class="lineNum">    3286</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L3287"><span class="lineNum">    3287</span>              : </span>
<span id="L3288"><span class="lineNum">    3288</span>              :       return std::__is_sorted_until(__first, __last,</span>
<span id="L3289"><span class="lineNum">    3289</span>              :                                     __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L3290"><span class="lineNum">    3290</span>              :     }</span>
<span id="L3291"><span class="lineNum">    3291</span>              : </span>
<span id="L3292"><span class="lineNum">    3292</span>              :   /**</span>
<span id="L3293"><span class="lineNum">    3293</span>              :    *  @brief  Determines the end of a sorted sequence using comparison functor.</span>
<span id="L3294"><span class="lineNum">    3294</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3295"><span class="lineNum">    3295</span>              :    *  @param  __first   An iterator.</span>
<span id="L3296"><span class="lineNum">    3296</span>              :    *  @param  __last    Another iterator.</span>
<span id="L3297"><span class="lineNum">    3297</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L3298"><span class="lineNum">    3298</span>              :    *  @return  An iterator pointing to the last iterator i in [__first, __last)</span>
<span id="L3299"><span class="lineNum">    3299</span>              :    *           for which the range [__first, i) is sorted.</span>
<span id="L3300"><span class="lineNum">    3300</span>              :   */</span>
<span id="L3301"><span class="lineNum">    3301</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L3302"><span class="lineNum">    3302</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3303"><span class="lineNum">    3303</span>              :     inline _ForwardIterator</span>
<span id="L3304"><span class="lineNum">    3304</span>              :     is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L3305"><span class="lineNum">    3305</span>              :                     _Compare __comp)</span>
<span id="L3306"><span class="lineNum">    3306</span>              :     {</span>
<span id="L3307"><span class="lineNum">    3307</span>              :       // concept requirements</span>
<span id="L3308"><span class="lineNum">    3308</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3309"><span class="lineNum">    3309</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L3310"><span class="lineNum">    3310</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L3311"><span class="lineNum">    3311</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3312"><span class="lineNum">    3312</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3313"><span class="lineNum">    3313</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L3314"><span class="lineNum">    3314</span>              : </span>
<span id="L3315"><span class="lineNum">    3315</span>              :       return std::__is_sorted_until(__first, __last,</span>
<span id="L3316"><span class="lineNum">    3316</span>              :                                     __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L3317"><span class="lineNum">    3317</span>              :     }</span>
<span id="L3318"><span class="lineNum">    3318</span>              : </span>
<span id="L3319"><span class="lineNum">    3319</span>              :   /**</span>
<span id="L3320"><span class="lineNum">    3320</span>              :    *  @brief  Determines min and max at once as an ordered pair.</span>
<span id="L3321"><span class="lineNum">    3321</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3322"><span class="lineNum">    3322</span>              :    *  @param  __a  A thing of arbitrary type.</span>
<span id="L3323"><span class="lineNum">    3323</span>              :    *  @param  __b  Another thing of arbitrary type.</span>
<span id="L3324"><span class="lineNum">    3324</span>              :    *  @return A pair(__b, __a) if __b is smaller than __a, pair(__a,</span>
<span id="L3325"><span class="lineNum">    3325</span>              :    *  __b) otherwise.</span>
<span id="L3326"><span class="lineNum">    3326</span>              :   */</span>
<span id="L3327"><span class="lineNum">    3327</span>              :   template&lt;typename _Tp&gt;</span>
<span id="L3328"><span class="lineNum">    3328</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3329"><span class="lineNum">    3329</span>              :     inline pair&lt;const _Tp&amp;, const _Tp&amp;&gt;</span>
<span id="L3330"><span class="lineNum">    3330</span>              :     minmax(const _Tp&amp; __a, const _Tp&amp; __b)</span>
<span id="L3331"><span class="lineNum">    3331</span>              :     {</span>
<span id="L3332"><span class="lineNum">    3332</span>              :       // concept requirements</span>
<span id="L3333"><span class="lineNum">    3333</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;_Tp&gt;)</span>
<span id="L3334"><span class="lineNum">    3334</span>              : </span>
<span id="L3335"><span class="lineNum">    3335</span>              :       return __b &lt; __a ? pair&lt;const _Tp&amp;, const _Tp&amp;&gt;(__b, __a)</span>
<span id="L3336"><span class="lineNum">    3336</span>              :                        : pair&lt;const _Tp&amp;, const _Tp&amp;&gt;(__a, __b);</span>
<span id="L3337"><span class="lineNum">    3337</span>              :     }</span>
<span id="L3338"><span class="lineNum">    3338</span>              : </span>
<span id="L3339"><span class="lineNum">    3339</span>              :   /**</span>
<span id="L3340"><span class="lineNum">    3340</span>              :    *  @brief  Determines min and max at once as an ordered pair.</span>
<span id="L3341"><span class="lineNum">    3341</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3342"><span class="lineNum">    3342</span>              :    *  @param  __a  A thing of arbitrary type.</span>
<span id="L3343"><span class="lineNum">    3343</span>              :    *  @param  __b  Another thing of arbitrary type.</span>
<span id="L3344"><span class="lineNum">    3344</span>              :    *  @param  __comp  A @link comparison_functors comparison functor @endlink.</span>
<span id="L3345"><span class="lineNum">    3345</span>              :    *  @return A pair(__b, __a) if __b is smaller than __a, pair(__a,</span>
<span id="L3346"><span class="lineNum">    3346</span>              :    *  __b) otherwise.</span>
<span id="L3347"><span class="lineNum">    3347</span>              :   */</span>
<span id="L3348"><span class="lineNum">    3348</span>              :   template&lt;typename _Tp, typename _Compare&gt;</span>
<span id="L3349"><span class="lineNum">    3349</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3350"><span class="lineNum">    3350</span>              :     inline pair&lt;const _Tp&amp;, const _Tp&amp;&gt;</span>
<span id="L3351"><span class="lineNum">    3351</span>              :     minmax(const _Tp&amp; __a, const _Tp&amp; __b, _Compare __comp)</span>
<span id="L3352"><span class="lineNum">    3352</span>              :     {</span>
<span id="L3353"><span class="lineNum">    3353</span>              :       return __comp(__b, __a) ? pair&lt;const _Tp&amp;, const _Tp&amp;&gt;(__b, __a)</span>
<span id="L3354"><span class="lineNum">    3354</span>              :                               : pair&lt;const _Tp&amp;, const _Tp&amp;&gt;(__a, __b);</span>
<span id="L3355"><span class="lineNum">    3355</span>              :     }</span>
<span id="L3356"><span class="lineNum">    3356</span>              : </span>
<span id="L3357"><span class="lineNum">    3357</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L3358"><span class="lineNum">    3358</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3359"><span class="lineNum">    3359</span>              :     pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L3360"><span class="lineNum">    3360</span>              :     __minmax_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L3361"><span class="lineNum">    3361</span>              :                      _Compare __comp)</span>
<span id="L3362"><span class="lineNum">    3362</span>              :     {</span>
<span id="L3363"><span class="lineNum">    3363</span>              :       _ForwardIterator __next = __first;</span>
<span id="L3364"><span class="lineNum">    3364</span>              :       if (__first == __last</span>
<span id="L3365"><span class="lineNum">    3365</span>              :           || ++__next == __last)</span>
<span id="L3366"><span class="lineNum">    3366</span>              :         return std::make_pair(__first, __first);</span>
<span id="L3367"><span class="lineNum">    3367</span>              : </span>
<span id="L3368"><span class="lineNum">    3368</span>              :       _ForwardIterator __min{}, __max{};</span>
<span id="L3369"><span class="lineNum">    3369</span>              :       if (__comp(__next, __first))</span>
<span id="L3370"><span class="lineNum">    3370</span>              :         {</span>
<span id="L3371"><span class="lineNum">    3371</span>              :           __min = __next;</span>
<span id="L3372"><span class="lineNum">    3372</span>              :           __max = __first;</span>
<span id="L3373"><span class="lineNum">    3373</span>              :         }</span>
<span id="L3374"><span class="lineNum">    3374</span>              :       else</span>
<span id="L3375"><span class="lineNum">    3375</span>              :         {</span>
<span id="L3376"><span class="lineNum">    3376</span>              :           __min = __first;</span>
<span id="L3377"><span class="lineNum">    3377</span>              :           __max = __next;</span>
<span id="L3378"><span class="lineNum">    3378</span>              :         }</span>
<span id="L3379"><span class="lineNum">    3379</span>              : </span>
<span id="L3380"><span class="lineNum">    3380</span>              :       __first = __next;</span>
<span id="L3381"><span class="lineNum">    3381</span>              :       ++__first;</span>
<span id="L3382"><span class="lineNum">    3382</span>              : </span>
<span id="L3383"><span class="lineNum">    3383</span>              :       while (__first != __last)</span>
<span id="L3384"><span class="lineNum">    3384</span>              :         {</span>
<span id="L3385"><span class="lineNum">    3385</span>              :           __next = __first;</span>
<span id="L3386"><span class="lineNum">    3386</span>              :           if (++__next == __last)</span>
<span id="L3387"><span class="lineNum">    3387</span>              :             {</span>
<span id="L3388"><span class="lineNum">    3388</span>              :               if (__comp(__first, __min))</span>
<span id="L3389"><span class="lineNum">    3389</span>              :                 __min = __first;</span>
<span id="L3390"><span class="lineNum">    3390</span>              :               else if (!__comp(__first, __max))</span>
<span id="L3391"><span class="lineNum">    3391</span>              :                 __max = __first;</span>
<span id="L3392"><span class="lineNum">    3392</span>              :               break;</span>
<span id="L3393"><span class="lineNum">    3393</span>              :             }</span>
<span id="L3394"><span class="lineNum">    3394</span>              : </span>
<span id="L3395"><span class="lineNum">    3395</span>              :           if (__comp(__next, __first))</span>
<span id="L3396"><span class="lineNum">    3396</span>              :             {</span>
<span id="L3397"><span class="lineNum">    3397</span>              :               if (__comp(__next, __min))</span>
<span id="L3398"><span class="lineNum">    3398</span>              :                 __min = __next;</span>
<span id="L3399"><span class="lineNum">    3399</span>              :               if (!__comp(__first, __max))</span>
<span id="L3400"><span class="lineNum">    3400</span>              :                 __max = __first;</span>
<span id="L3401"><span class="lineNum">    3401</span>              :             }</span>
<span id="L3402"><span class="lineNum">    3402</span>              :           else</span>
<span id="L3403"><span class="lineNum">    3403</span>              :             {</span>
<span id="L3404"><span class="lineNum">    3404</span>              :               if (__comp(__first, __min))</span>
<span id="L3405"><span class="lineNum">    3405</span>              :                 __min = __first;</span>
<span id="L3406"><span class="lineNum">    3406</span>              :               if (!__comp(__next, __max))</span>
<span id="L3407"><span class="lineNum">    3407</span>              :                 __max = __next;</span>
<span id="L3408"><span class="lineNum">    3408</span>              :             }</span>
<span id="L3409"><span class="lineNum">    3409</span>              : </span>
<span id="L3410"><span class="lineNum">    3410</span>              :           __first = __next;</span>
<span id="L3411"><span class="lineNum">    3411</span>              :           ++__first;</span>
<span id="L3412"><span class="lineNum">    3412</span>              :         }</span>
<span id="L3413"><span class="lineNum">    3413</span>              : </span>
<span id="L3414"><span class="lineNum">    3414</span>              :       return std::make_pair(__min, __max);</span>
<span id="L3415"><span class="lineNum">    3415</span>              :     }</span>
<span id="L3416"><span class="lineNum">    3416</span>              : </span>
<span id="L3417"><span class="lineNum">    3417</span>              :   /**</span>
<span id="L3418"><span class="lineNum">    3418</span>              :    *  @brief  Return a pair of iterators pointing to the minimum and maximum</span>
<span id="L3419"><span class="lineNum">    3419</span>              :    *          elements in a range.</span>
<span id="L3420"><span class="lineNum">    3420</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3421"><span class="lineNum">    3421</span>              :    *  @param  __first  Start of range.</span>
<span id="L3422"><span class="lineNum">    3422</span>              :    *  @param  __last   End of range.</span>
<span id="L3423"><span class="lineNum">    3423</span>              :    *  @return  make_pair(m, M), where m is the first iterator i in </span>
<span id="L3424"><span class="lineNum">    3424</span>              :    *           [__first, __last) such that no other element in the range is</span>
<span id="L3425"><span class="lineNum">    3425</span>              :    *           smaller, and where M is the last iterator i in [__first, __last)</span>
<span id="L3426"><span class="lineNum">    3426</span>              :    *           such that no other element in the range is larger.</span>
<span id="L3427"><span class="lineNum">    3427</span>              :   */</span>
<span id="L3428"><span class="lineNum">    3428</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L3429"><span class="lineNum">    3429</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3430"><span class="lineNum">    3430</span>              :     inline pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L3431"><span class="lineNum">    3431</span>              :     minmax_element(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L3432"><span class="lineNum">    3432</span>              :     {</span>
<span id="L3433"><span class="lineNum">    3433</span>              :       // concept requirements</span>
<span id="L3434"><span class="lineNum">    3434</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3435"><span class="lineNum">    3435</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L3436"><span class="lineNum">    3436</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3437"><span class="lineNum">    3437</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3438"><span class="lineNum">    3438</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L3439"><span class="lineNum">    3439</span>              : </span>
<span id="L3440"><span class="lineNum">    3440</span>              :       return std::__minmax_element(__first, __last,</span>
<span id="L3441"><span class="lineNum">    3441</span>              :                                    __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L3442"><span class="lineNum">    3442</span>              :     }</span>
<span id="L3443"><span class="lineNum">    3443</span>              : </span>
<span id="L3444"><span class="lineNum">    3444</span>              :   /**</span>
<span id="L3445"><span class="lineNum">    3445</span>              :    *  @brief  Return a pair of iterators pointing to the minimum and maximum</span>
<span id="L3446"><span class="lineNum">    3446</span>              :    *          elements in a range.</span>
<span id="L3447"><span class="lineNum">    3447</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3448"><span class="lineNum">    3448</span>              :    *  @param  __first  Start of range.</span>
<span id="L3449"><span class="lineNum">    3449</span>              :    *  @param  __last   End of range.</span>
<span id="L3450"><span class="lineNum">    3450</span>              :    *  @param  __comp   Comparison functor.</span>
<span id="L3451"><span class="lineNum">    3451</span>              :    *  @return  make_pair(m, M), where m is the first iterator i in </span>
<span id="L3452"><span class="lineNum">    3452</span>              :    *           [__first, __last) such that no other element in the range is</span>
<span id="L3453"><span class="lineNum">    3453</span>              :    *           smaller, and where M is the last iterator i in [__first, __last)</span>
<span id="L3454"><span class="lineNum">    3454</span>              :    *           such that no other element in the range is larger.</span>
<span id="L3455"><span class="lineNum">    3455</span>              :   */</span>
<span id="L3456"><span class="lineNum">    3456</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L3457"><span class="lineNum">    3457</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3458"><span class="lineNum">    3458</span>              :     inline pair&lt;_ForwardIterator, _ForwardIterator&gt;</span>
<span id="L3459"><span class="lineNum">    3459</span>              :     minmax_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L3460"><span class="lineNum">    3460</span>              :                    _Compare __comp)</span>
<span id="L3461"><span class="lineNum">    3461</span>              :     {</span>
<span id="L3462"><span class="lineNum">    3462</span>              :       // concept requirements</span>
<span id="L3463"><span class="lineNum">    3463</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3464"><span class="lineNum">    3464</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L3465"><span class="lineNum">    3465</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L3466"><span class="lineNum">    3466</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3467"><span class="lineNum">    3467</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3468"><span class="lineNum">    3468</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L3469"><span class="lineNum">    3469</span>              : </span>
<span id="L3470"><span class="lineNum">    3470</span>              :       return std::__minmax_element(__first, __last,</span>
<span id="L3471"><span class="lineNum">    3471</span>              :                                    __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L3472"><span class="lineNum">    3472</span>              :     }</span>
<span id="L3473"><span class="lineNum">    3473</span>              : </span>
<span id="L3474"><span class="lineNum">    3474</span>              :   template&lt;typename _Tp&gt;</span>
<span id="L3475"><span class="lineNum">    3475</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3476"><span class="lineNum">    3476</span>              :     inline pair&lt;_Tp, _Tp&gt;</span>
<span id="L3477"><span class="lineNum">    3477</span>              :     minmax(initializer_list&lt;_Tp&gt; __l)</span>
<span id="L3478"><span class="lineNum">    3478</span>              :     {</span>
<span id="L3479"><span class="lineNum">    3479</span>              :       __glibcxx_requires_irreflexive(__l.begin(), __l.end());</span>
<span id="L3480"><span class="lineNum">    3480</span>              :       pair&lt;const _Tp*, const _Tp*&gt; __p =</span>
<span id="L3481"><span class="lineNum">    3481</span>              :         std::__minmax_element(__l.begin(), __l.end(),</span>
<span id="L3482"><span class="lineNum">    3482</span>              :                               __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L3483"><span class="lineNum">    3483</span>              :       return std::make_pair(*__p.first, *__p.second);</span>
<span id="L3484"><span class="lineNum">    3484</span>              :     }</span>
<span id="L3485"><span class="lineNum">    3485</span>              : </span>
<span id="L3486"><span class="lineNum">    3486</span>              :   template&lt;typename _Tp, typename _Compare&gt;</span>
<span id="L3487"><span class="lineNum">    3487</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L3488"><span class="lineNum">    3488</span>              :     inline pair&lt;_Tp, _Tp&gt;</span>
<span id="L3489"><span class="lineNum">    3489</span>              :     minmax(initializer_list&lt;_Tp&gt; __l, _Compare __comp)</span>
<span id="L3490"><span class="lineNum">    3490</span>              :     {</span>
<span id="L3491"><span class="lineNum">    3491</span>              :       __glibcxx_requires_irreflexive_pred(__l.begin(), __l.end(), __comp);</span>
<span id="L3492"><span class="lineNum">    3492</span>              :       pair&lt;const _Tp*, const _Tp*&gt; __p =</span>
<span id="L3493"><span class="lineNum">    3493</span>              :         std::__minmax_element(__l.begin(), __l.end(),</span>
<span id="L3494"><span class="lineNum">    3494</span>              :                               __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L3495"><span class="lineNum">    3495</span>              :       return std::make_pair(*__p.first, *__p.second);</span>
<span id="L3496"><span class="lineNum">    3496</span>              :     }</span>
<span id="L3497"><span class="lineNum">    3497</span>              : </span>
<span id="L3498"><span class="lineNum">    3498</span>              :   /**</span>
<span id="L3499"><span class="lineNum">    3499</span>              :    *  @brief  Checks whether a permutation of the second sequence is equal</span>
<span id="L3500"><span class="lineNum">    3500</span>              :    *          to the first sequence.</span>
<span id="L3501"><span class="lineNum">    3501</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3502"><span class="lineNum">    3502</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L3503"><span class="lineNum">    3503</span>              :    *  @param  __last1   End of first range.</span>
<span id="L3504"><span class="lineNum">    3504</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L3505"><span class="lineNum">    3505</span>              :    *  @param  __pred    A binary predicate.</span>
<span id="L3506"><span class="lineNum">    3506</span>              :    *  @return true if there exists a permutation of the elements in</span>
<span id="L3507"><span class="lineNum">    3507</span>              :    *          the range [__first2, __first2 + (__last1 - __first1)),</span>
<span id="L3508"><span class="lineNum">    3508</span>              :    *          beginning with ForwardIterator2 begin, such that</span>
<span id="L3509"><span class="lineNum">    3509</span>              :    *          equal(__first1, __last1, __begin, __pred) returns true;</span>
<span id="L3510"><span class="lineNum">    3510</span>              :    *          otherwise, returns false.</span>
<span id="L3511"><span class="lineNum">    3511</span>              :   */</span>
<span id="L3512"><span class="lineNum">    3512</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L3513"><span class="lineNum">    3513</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L3514"><span class="lineNum">    3514</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3515"><span class="lineNum">    3515</span>              :     inline bool</span>
<span id="L3516"><span class="lineNum">    3516</span>              :     is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L3517"><span class="lineNum">    3517</span>              :                    _ForwardIterator2 __first2, _BinaryPredicate __pred)</span>
<span id="L3518"><span class="lineNum">    3518</span>              :     {</span>
<span id="L3519"><span class="lineNum">    3519</span>              :       // concept requirements</span>
<span id="L3520"><span class="lineNum">    3520</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator1&gt;)</span>
<span id="L3521"><span class="lineNum">    3521</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator2&gt;)</span>
<span id="L3522"><span class="lineNum">    3522</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L3523"><span class="lineNum">    3523</span>              :             typename iterator_traits&lt;_ForwardIterator1&gt;::value_type,</span>
<span id="L3524"><span class="lineNum">    3524</span>              :             typename iterator_traits&lt;_ForwardIterator2&gt;::value_type&gt;)</span>
<span id="L3525"><span class="lineNum">    3525</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L3526"><span class="lineNum">    3526</span>              : </span>
<span id="L3527"><span class="lineNum">    3527</span>              :       return std::__is_permutation(__first1, __last1, __first2,</span>
<span id="L3528"><span class="lineNum">    3528</span>              :                                    __gnu_cxx::__ops::__iter_comp_iter(__pred));</span>
<span id="L3529"><span class="lineNum">    3529</span>              :     }</span>
<span id="L3530"><span class="lineNum">    3530</span>              : </span>
<span id="L3531"><span class="lineNum">    3531</span>              : #if __cplusplus &gt; 201103L</span>
<span id="L3532"><span class="lineNum">    3532</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L3533"><span class="lineNum">    3533</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L3534"><span class="lineNum">    3534</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3535"><span class="lineNum">    3535</span>              :     bool</span>
<span id="L3536"><span class="lineNum">    3536</span>              :     __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L3537"><span class="lineNum">    3537</span>              :                      _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L3538"><span class="lineNum">    3538</span>              :                      _BinaryPredicate __pred)</span>
<span id="L3539"><span class="lineNum">    3539</span>              :     {</span>
<span id="L3540"><span class="lineNum">    3540</span>              :       using _Cat1</span>
<span id="L3541"><span class="lineNum">    3541</span>              :         = typename iterator_traits&lt;_ForwardIterator1&gt;::iterator_category;</span>
<span id="L3542"><span class="lineNum">    3542</span>              :       using _Cat2</span>
<span id="L3543"><span class="lineNum">    3543</span>              :         = typename iterator_traits&lt;_ForwardIterator2&gt;::iterator_category;</span>
<span id="L3544"><span class="lineNum">    3544</span>              :       using _It1_is_RA = is_same&lt;_Cat1, random_access_iterator_tag&gt;;</span>
<span id="L3545"><span class="lineNum">    3545</span>              :       using _It2_is_RA = is_same&lt;_Cat2, random_access_iterator_tag&gt;;</span>
<span id="L3546"><span class="lineNum">    3546</span>              :       constexpr bool __ra_iters = _It1_is_RA() &amp;&amp; _It2_is_RA();</span>
<span id="L3547"><span class="lineNum">    3547</span>              :       if (__ra_iters)</span>
<span id="L3548"><span class="lineNum">    3548</span>              :         {</span>
<span id="L3549"><span class="lineNum">    3549</span>              :           auto __d1 = std::distance(__first1, __last1);</span>
<span id="L3550"><span class="lineNum">    3550</span>              :           auto __d2 = std::distance(__first2, __last2);</span>
<span id="L3551"><span class="lineNum">    3551</span>              :           if (__d1 != __d2)</span>
<span id="L3552"><span class="lineNum">    3552</span>              :             return false;</span>
<span id="L3553"><span class="lineNum">    3553</span>              :         }</span>
<span id="L3554"><span class="lineNum">    3554</span>              : </span>
<span id="L3555"><span class="lineNum">    3555</span>              :       // Efficiently compare identical prefixes:  O(N) if sequences</span>
<span id="L3556"><span class="lineNum">    3556</span>              :       // have the same elements in the same order.</span>
<span id="L3557"><span class="lineNum">    3557</span>              :       for (; __first1 != __last1 &amp;&amp; __first2 != __last2;</span>
<span id="L3558"><span class="lineNum">    3558</span>              :           ++__first1, (void)++__first2)</span>
<span id="L3559"><span class="lineNum">    3559</span>              :         if (!__pred(__first1, __first2))</span>
<span id="L3560"><span class="lineNum">    3560</span>              :           break;</span>
<span id="L3561"><span class="lineNum">    3561</span>              : </span>
<span id="L3562"><span class="lineNum">    3562</span>              :       if (__ra_iters)</span>
<span id="L3563"><span class="lineNum">    3563</span>              :         {</span>
<span id="L3564"><span class="lineNum">    3564</span>              :           if (__first1 == __last1)</span>
<span id="L3565"><span class="lineNum">    3565</span>              :             return true;</span>
<span id="L3566"><span class="lineNum">    3566</span>              :         }</span>
<span id="L3567"><span class="lineNum">    3567</span>              :       else</span>
<span id="L3568"><span class="lineNum">    3568</span>              :         {</span>
<span id="L3569"><span class="lineNum">    3569</span>              :           auto __d1 = std::distance(__first1, __last1);</span>
<span id="L3570"><span class="lineNum">    3570</span>              :           auto __d2 = std::distance(__first2, __last2);</span>
<span id="L3571"><span class="lineNum">    3571</span>              :           if (__d1 == 0 &amp;&amp; __d2 == 0)</span>
<span id="L3572"><span class="lineNum">    3572</span>              :             return true;</span>
<span id="L3573"><span class="lineNum">    3573</span>              :           if (__d1 != __d2)</span>
<span id="L3574"><span class="lineNum">    3574</span>              :             return false;</span>
<span id="L3575"><span class="lineNum">    3575</span>              :         }</span>
<span id="L3576"><span class="lineNum">    3576</span>              : </span>
<span id="L3577"><span class="lineNum">    3577</span>              :       for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan)</span>
<span id="L3578"><span class="lineNum">    3578</span>              :         {</span>
<span id="L3579"><span class="lineNum">    3579</span>              :           if (__scan != std::__find_if(__first1, __scan,</span>
<span id="L3580"><span class="lineNum">    3580</span>              :                         __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)))</span>
<span id="L3581"><span class="lineNum">    3581</span>              :             continue; // We've seen this one before.</span>
<span id="L3582"><span class="lineNum">    3582</span>              : </span>
<span id="L3583"><span class="lineNum">    3583</span>              :           auto __matches = std::__count_if(__first2, __last2,</span>
<span id="L3584"><span class="lineNum">    3584</span>              :                 __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan));</span>
<span id="L3585"><span class="lineNum">    3585</span>              :           if (0 == __matches</span>
<span id="L3586"><span class="lineNum">    3586</span>              :               || std::__count_if(__scan, __last1,</span>
<span id="L3587"><span class="lineNum">    3587</span>              :                         __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan))</span>
<span id="L3588"><span class="lineNum">    3588</span>              :               != __matches)</span>
<span id="L3589"><span class="lineNum">    3589</span>              :             return false;</span>
<span id="L3590"><span class="lineNum">    3590</span>              :         }</span>
<span id="L3591"><span class="lineNum">    3591</span>              :       return true;</span>
<span id="L3592"><span class="lineNum">    3592</span>              :     }</span>
<span id="L3593"><span class="lineNum">    3593</span>              : </span>
<span id="L3594"><span class="lineNum">    3594</span>              :   /**</span>
<span id="L3595"><span class="lineNum">    3595</span>              :    *  @brief  Checks whether a permutaion of the second sequence is equal</span>
<span id="L3596"><span class="lineNum">    3596</span>              :    *          to the first sequence.</span>
<span id="L3597"><span class="lineNum">    3597</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3598"><span class="lineNum">    3598</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L3599"><span class="lineNum">    3599</span>              :    *  @param  __last1   End of first range.</span>
<span id="L3600"><span class="lineNum">    3600</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L3601"><span class="lineNum">    3601</span>              :    *  @param  __last2   End of first range.</span>
<span id="L3602"><span class="lineNum">    3602</span>              :    *  @return true if there exists a permutation of the elements in the range</span>
<span id="L3603"><span class="lineNum">    3603</span>              :    *          [__first2, __last2), beginning with ForwardIterator2 begin,</span>
<span id="L3604"><span class="lineNum">    3604</span>              :    *          such that equal(__first1, __last1, begin) returns true;</span>
<span id="L3605"><span class="lineNum">    3605</span>              :    *          otherwise, returns false.</span>
<span id="L3606"><span class="lineNum">    3606</span>              :   */</span>
<span id="L3607"><span class="lineNum">    3607</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2&gt;</span>
<span id="L3608"><span class="lineNum">    3608</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3609"><span class="lineNum">    3609</span>              :     inline bool</span>
<span id="L3610"><span class="lineNum">    3610</span>              :     is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L3611"><span class="lineNum">    3611</span>              :                    _ForwardIterator2 __first2, _ForwardIterator2 __last2)</span>
<span id="L3612"><span class="lineNum">    3612</span>              :     {</span>
<span id="L3613"><span class="lineNum">    3613</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L3614"><span class="lineNum">    3614</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L3615"><span class="lineNum">    3615</span>              : </span>
<span id="L3616"><span class="lineNum">    3616</span>              :       return</span>
<span id="L3617"><span class="lineNum">    3617</span>              :         std::__is_permutation(__first1, __last1, __first2, __last2,</span>
<span id="L3618"><span class="lineNum">    3618</span>              :                               __gnu_cxx::__ops::__iter_equal_to_iter());</span>
<span id="L3619"><span class="lineNum">    3619</span>              :     }</span>
<span id="L3620"><span class="lineNum">    3620</span>              : </span>
<span id="L3621"><span class="lineNum">    3621</span>              :   /**</span>
<span id="L3622"><span class="lineNum">    3622</span>              :    *  @brief  Checks whether a permutation of the second sequence is equal</span>
<span id="L3623"><span class="lineNum">    3623</span>              :    *          to the first sequence.</span>
<span id="L3624"><span class="lineNum">    3624</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3625"><span class="lineNum">    3625</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L3626"><span class="lineNum">    3626</span>              :    *  @param  __last1   End of first range.</span>
<span id="L3627"><span class="lineNum">    3627</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L3628"><span class="lineNum">    3628</span>              :    *  @param  __last2   End of first range.</span>
<span id="L3629"><span class="lineNum">    3629</span>              :    *  @param  __pred    A binary predicate.</span>
<span id="L3630"><span class="lineNum">    3630</span>              :    *  @return true if there exists a permutation of the elements in the range</span>
<span id="L3631"><span class="lineNum">    3631</span>              :    *          [__first2, __last2), beginning with ForwardIterator2 begin,</span>
<span id="L3632"><span class="lineNum">    3632</span>              :    *          such that equal(__first1, __last1, __begin, __pred) returns true;</span>
<span id="L3633"><span class="lineNum">    3633</span>              :    *          otherwise, returns false.</span>
<span id="L3634"><span class="lineNum">    3634</span>              :   */</span>
<span id="L3635"><span class="lineNum">    3635</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L3636"><span class="lineNum">    3636</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L3637"><span class="lineNum">    3637</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3638"><span class="lineNum">    3638</span>              :     inline bool</span>
<span id="L3639"><span class="lineNum">    3639</span>              :     is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L3640"><span class="lineNum">    3640</span>              :                    _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L3641"><span class="lineNum">    3641</span>              :                    _BinaryPredicate __pred)</span>
<span id="L3642"><span class="lineNum">    3642</span>              :     {</span>
<span id="L3643"><span class="lineNum">    3643</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L3644"><span class="lineNum">    3644</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L3645"><span class="lineNum">    3645</span>              : </span>
<span id="L3646"><span class="lineNum">    3646</span>              :       return std::__is_permutation(__first1, __last1, __first2, __last2,</span>
<span id="L3647"><span class="lineNum">    3647</span>              :                                    __gnu_cxx::__ops::__iter_comp_iter(__pred));</span>
<span id="L3648"><span class="lineNum">    3648</span>              :     }</span>
<span id="L3649"><span class="lineNum">    3649</span>              : </span>
<span id="L3650"><span class="lineNum">    3650</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L3651"><span class="lineNum">    3651</span>              : </span>
<span id="L3652"><span class="lineNum">    3652</span>              : #define __cpp_lib_clamp 201603L</span>
<span id="L3653"><span class="lineNum">    3653</span>              : </span>
<span id="L3654"><span class="lineNum">    3654</span>              :   /**</span>
<span id="L3655"><span class="lineNum">    3655</span>              :    *  @brief  Returns the value clamped between lo and hi.</span>
<span id="L3656"><span class="lineNum">    3656</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3657"><span class="lineNum">    3657</span>              :    *  @param  __val  A value of arbitrary type.</span>
<span id="L3658"><span class="lineNum">    3658</span>              :    *  @param  __lo   A lower limit of arbitrary type.</span>
<span id="L3659"><span class="lineNum">    3659</span>              :    *  @param  __hi   An upper limit of arbitrary type.</span>
<span id="L3660"><span class="lineNum">    3660</span>              :    *  @retval `__lo` if `__val &lt; __lo`</span>
<span id="L3661"><span class="lineNum">    3661</span>              :    *  @retval `__hi` if `__hi &lt; __val`</span>
<span id="L3662"><span class="lineNum">    3662</span>              :    *  @retval `__val` otherwise.</span>
<span id="L3663"><span class="lineNum">    3663</span>              :    *  @pre `_Tp` is LessThanComparable and `(__hi &lt; __lo)` is false.</span>
<span id="L3664"><span class="lineNum">    3664</span>              :    */</span>
<span id="L3665"><span class="lineNum">    3665</span>              :   template&lt;typename _Tp&gt;</span>
<span id="L3666"><span class="lineNum">    3666</span>              :     constexpr const _Tp&amp;</span>
<span id="L3667"><span class="lineNum">    3667</span>              :     clamp(const _Tp&amp; __val, const _Tp&amp; __lo, const _Tp&amp; __hi)</span>
<span id="L3668"><span class="lineNum">    3668</span>              :     {</span>
<span id="L3669"><span class="lineNum">    3669</span>              :       __glibcxx_assert(!(__hi &lt; __lo));</span>
<span id="L3670"><span class="lineNum">    3670</span>              :       return std::min(std::max(__val, __lo), __hi);</span>
<span id="L3671"><span class="lineNum">    3671</span>              :     }</span>
<span id="L3672"><span class="lineNum">    3672</span>              : </span>
<span id="L3673"><span class="lineNum">    3673</span>              :   /**</span>
<span id="L3674"><span class="lineNum">    3674</span>              :    *  @brief  Returns the value clamped between lo and hi.</span>
<span id="L3675"><span class="lineNum">    3675</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L3676"><span class="lineNum">    3676</span>              :    *  @param  __val   A value of arbitrary type.</span>
<span id="L3677"><span class="lineNum">    3677</span>              :    *  @param  __lo    A lower limit of arbitrary type.</span>
<span id="L3678"><span class="lineNum">    3678</span>              :    *  @param  __hi    An upper limit of arbitrary type.</span>
<span id="L3679"><span class="lineNum">    3679</span>              :    *  @param  __comp  A comparison functor.</span>
<span id="L3680"><span class="lineNum">    3680</span>              :    *  @retval `__lo` if `__comp(__val, __lo)`</span>
<span id="L3681"><span class="lineNum">    3681</span>              :    *  @retval `__hi` if `__comp(__hi, __val)`</span>
<span id="L3682"><span class="lineNum">    3682</span>              :    *  @retval `__val` otherwise.</span>
<span id="L3683"><span class="lineNum">    3683</span>              :    *  @pre `__comp(__hi, __lo)` is false.</span>
<span id="L3684"><span class="lineNum">    3684</span>              :    */</span>
<span id="L3685"><span class="lineNum">    3685</span>              :   template&lt;typename _Tp, typename _Compare&gt;</span>
<span id="L3686"><span class="lineNum">    3686</span>              :     constexpr const _Tp&amp;</span>
<span id="L3687"><span class="lineNum">    3687</span>              :     clamp(const _Tp&amp; __val, const _Tp&amp; __lo, const _Tp&amp; __hi, _Compare __comp)</span>
<span id="L3688"><span class="lineNum">    3688</span>              :     {</span>
<span id="L3689"><span class="lineNum">    3689</span>              :       __glibcxx_assert(!__comp(__hi, __lo));</span>
<span id="L3690"><span class="lineNum">    3690</span>              :       return std::min(std::max(__val, __lo, __comp), __hi, __comp);</span>
<span id="L3691"><span class="lineNum">    3691</span>              :     }</span>
<span id="L3692"><span class="lineNum">    3692</span>              : #endif // C++17</span>
<span id="L3693"><span class="lineNum">    3693</span>              : #endif // C++14</span>
<span id="L3694"><span class="lineNum">    3694</span>              : </span>
<span id="L3695"><span class="lineNum">    3695</span>              : #ifdef _GLIBCXX_USE_C99_STDINT_TR1</span>
<span id="L3696"><span class="lineNum">    3696</span>              :   /**</span>
<span id="L3697"><span class="lineNum">    3697</span>              :    *  @brief Generate two uniformly distributed integers using a</span>
<span id="L3698"><span class="lineNum">    3698</span>              :    *         single distribution invocation.</span>
<span id="L3699"><span class="lineNum">    3699</span>              :    *  @param  __b0    The upper bound for the first integer.</span>
<span id="L3700"><span class="lineNum">    3700</span>              :    *  @param  __b1    The upper bound for the second integer.</span>
<span id="L3701"><span class="lineNum">    3701</span>              :    *  @param  __g     A UniformRandomBitGenerator.</span>
<span id="L3702"><span class="lineNum">    3702</span>              :    *  @return  A pair (i, j) with i and j uniformly distributed</span>
<span id="L3703"><span class="lineNum">    3703</span>              :    *           over [0, __b0) and [0, __b1), respectively.</span>
<span id="L3704"><span class="lineNum">    3704</span>              :    *</span>
<span id="L3705"><span class="lineNum">    3705</span>              :    *  Requires: __b0 * __b1 &lt;= __g.max() - __g.min().</span>
<span id="L3706"><span class="lineNum">    3706</span>              :    *</span>
<span id="L3707"><span class="lineNum">    3707</span>              :    *  Using uniform_int_distribution with a range that is very</span>
<span id="L3708"><span class="lineNum">    3708</span>              :    *  small relative to the range of the generator ends up wasting</span>
<span id="L3709"><span class="lineNum">    3709</span>              :    *  potentially expensively generated randomness, since</span>
<span id="L3710"><span class="lineNum">    3710</span>              :    *  uniform_int_distribution does not store leftover randomness</span>
<span id="L3711"><span class="lineNum">    3711</span>              :    *  between invocations.</span>
<span id="L3712"><span class="lineNum">    3712</span>              :    *</span>
<span id="L3713"><span class="lineNum">    3713</span>              :    *  If we know we want two integers in ranges that are sufficiently</span>
<span id="L3714"><span class="lineNum">    3714</span>              :    *  small, we can compose the ranges, use a single distribution</span>
<span id="L3715"><span class="lineNum">    3715</span>              :    *  invocation, and significantly reduce the waste.</span>
<span id="L3716"><span class="lineNum">    3716</span>              :   */</span>
<span id="L3717"><span class="lineNum">    3717</span>              :   template&lt;typename _IntType, typename _UniformRandomBitGenerator&gt;</span>
<span id="L3718"><span class="lineNum">    3718</span>              :     pair&lt;_IntType, _IntType&gt;</span>
<span id="L3719"><span class="lineNum">    3719</span>              :     __gen_two_uniform_ints(_IntType __b0, _IntType __b1,</span>
<span id="L3720"><span class="lineNum">    3720</span>              :                            _UniformRandomBitGenerator&amp;&amp; __g)</span>
<span id="L3721"><span class="lineNum">    3721</span>              :     {</span>
<span id="L3722"><span class="lineNum">    3722</span>              :       _IntType __x</span>
<span id="L3723"><span class="lineNum">    3723</span>              :         = uniform_int_distribution&lt;_IntType&gt;{0, (__b0 * __b1) - 1}(__g);</span>
<span id="L3724"><span class="lineNum">    3724</span>              :       return std::make_pair(__x / __b1, __x % __b1);</span>
<span id="L3725"><span class="lineNum">    3725</span>              :     }</span>
<span id="L3726"><span class="lineNum">    3726</span>              : </span>
<span id="L3727"><span class="lineNum">    3727</span>              :   /**</span>
<span id="L3728"><span class="lineNum">    3728</span>              :    *  @brief Shuffle the elements of a sequence using a uniform random</span>
<span id="L3729"><span class="lineNum">    3729</span>              :    *         number generator.</span>
<span id="L3730"><span class="lineNum">    3730</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L3731"><span class="lineNum">    3731</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L3732"><span class="lineNum">    3732</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L3733"><span class="lineNum">    3733</span>              :    *  @param  __g       A UniformRandomNumberGenerator (26.5.1.3).</span>
<span id="L3734"><span class="lineNum">    3734</span>              :    *  @return  Nothing.</span>
<span id="L3735"><span class="lineNum">    3735</span>              :    *</span>
<span id="L3736"><span class="lineNum">    3736</span>              :    *  Reorders the elements in the range @p [__first,__last) using @p __g to</span>
<span id="L3737"><span class="lineNum">    3737</span>              :    *  provide random numbers.</span>
<span id="L3738"><span class="lineNum">    3738</span>              :   */</span>
<span id="L3739"><span class="lineNum">    3739</span>              :   template&lt;typename _RandomAccessIterator,</span>
<span id="L3740"><span class="lineNum">    3740</span>              :            typename _UniformRandomNumberGenerator&gt;</span>
<span id="L3741"><span class="lineNum">    3741</span>              :     void</span>
<span id="L3742"><span class="lineNum">    3742</span>              :     shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L3743"><span class="lineNum">    3743</span>              :             _UniformRandomNumberGenerator&amp;&amp; __g)</span>
<span id="L3744"><span class="lineNum">    3744</span>              :     {</span>
<span id="L3745"><span class="lineNum">    3745</span>              :       // concept requirements</span>
<span id="L3746"><span class="lineNum">    3746</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L3747"><span class="lineNum">    3747</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L3748"><span class="lineNum">    3748</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3749"><span class="lineNum">    3749</span>              : </span>
<span id="L3750"><span class="lineNum">    3750</span>              :       if (__first == __last)</span>
<span id="L3751"><span class="lineNum">    3751</span>              :         return;</span>
<span id="L3752"><span class="lineNum">    3752</span>              : </span>
<span id="L3753"><span class="lineNum">    3753</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::difference_type</span>
<span id="L3754"><span class="lineNum">    3754</span>              :         _DistanceType;</span>
<span id="L3755"><span class="lineNum">    3755</span>              : </span>
<span id="L3756"><span class="lineNum">    3756</span>              :       typedef typename std::make_unsigned&lt;_DistanceType&gt;::type __ud_type;</span>
<span id="L3757"><span class="lineNum">    3757</span>              :       typedef typename std::uniform_int_distribution&lt;__ud_type&gt; __distr_type;</span>
<span id="L3758"><span class="lineNum">    3758</span>              :       typedef typename __distr_type::param_type __p_type;</span>
<span id="L3759"><span class="lineNum">    3759</span>              : </span>
<span id="L3760"><span class="lineNum">    3760</span>              :       typedef typename remove_reference&lt;_UniformRandomNumberGenerator&gt;::type</span>
<span id="L3761"><span class="lineNum">    3761</span>              :         _Gen;</span>
<span id="L3762"><span class="lineNum">    3762</span>              :       typedef typename common_type&lt;typename _Gen::result_type, __ud_type&gt;::type</span>
<span id="L3763"><span class="lineNum">    3763</span>              :         __uc_type;</span>
<span id="L3764"><span class="lineNum">    3764</span>              : </span>
<span id="L3765"><span class="lineNum">    3765</span>              :       const __uc_type __urngrange = __g.max() - __g.min();</span>
<span id="L3766"><span class="lineNum">    3766</span>              :       const __uc_type __urange = __uc_type(__last - __first);</span>
<span id="L3767"><span class="lineNum">    3767</span>              : </span>
<span id="L3768"><span class="lineNum">    3768</span>              :       if (__urngrange / __urange &gt;= __urange)</span>
<span id="L3769"><span class="lineNum">    3769</span>              :         // I.e. (__urngrange &gt;= __urange * __urange) but without wrap issues.</span>
<span id="L3770"><span class="lineNum">    3770</span>              :       {</span>
<span id="L3771"><span class="lineNum">    3771</span>              :         _RandomAccessIterator __i = __first + 1;</span>
<span id="L3772"><span class="lineNum">    3772</span>              : </span>
<span id="L3773"><span class="lineNum">    3773</span>              :         // Since we know the range isn't empty, an even number of elements</span>
<span id="L3774"><span class="lineNum">    3774</span>              :         // means an uneven number of elements /to swap/, in which case we</span>
<span id="L3775"><span class="lineNum">    3775</span>              :         // do the first one up front:</span>
<span id="L3776"><span class="lineNum">    3776</span>              : </span>
<span id="L3777"><span class="lineNum">    3777</span>              :         if ((__urange % 2) == 0)</span>
<span id="L3778"><span class="lineNum">    3778</span>              :         {</span>
<span id="L3779"><span class="lineNum">    3779</span>              :           __distr_type __d{0, 1};</span>
<span id="L3780"><span class="lineNum">    3780</span>              :           std::iter_swap(__i++, __first + __d(__g));</span>
<span id="L3781"><span class="lineNum">    3781</span>              :         }</span>
<span id="L3782"><span class="lineNum">    3782</span>              : </span>
<span id="L3783"><span class="lineNum">    3783</span>              :         // Now we know that __last - __i is even, so we do the rest in pairs,</span>
<span id="L3784"><span class="lineNum">    3784</span>              :         // using a single distribution invocation to produce swap positions</span>
<span id="L3785"><span class="lineNum">    3785</span>              :         // for two successive elements at a time:</span>
<span id="L3786"><span class="lineNum">    3786</span>              : </span>
<span id="L3787"><span class="lineNum">    3787</span>              :         while (__i != __last)</span>
<span id="L3788"><span class="lineNum">    3788</span>              :         {</span>
<span id="L3789"><span class="lineNum">    3789</span>              :           const __uc_type __swap_range = __uc_type(__i - __first) + 1;</span>
<span id="L3790"><span class="lineNum">    3790</span>              : </span>
<span id="L3791"><span class="lineNum">    3791</span>              :           const pair&lt;__uc_type, __uc_type&gt; __pospos =</span>
<span id="L3792"><span class="lineNum">    3792</span>              :             __gen_two_uniform_ints(__swap_range, __swap_range + 1, __g);</span>
<span id="L3793"><span class="lineNum">    3793</span>              : </span>
<span id="L3794"><span class="lineNum">    3794</span>              :           std::iter_swap(__i++, __first + __pospos.first);</span>
<span id="L3795"><span class="lineNum">    3795</span>              :           std::iter_swap(__i++, __first + __pospos.second);</span>
<span id="L3796"><span class="lineNum">    3796</span>              :         }</span>
<span id="L3797"><span class="lineNum">    3797</span>              : </span>
<span id="L3798"><span class="lineNum">    3798</span>              :         return;</span>
<span id="L3799"><span class="lineNum">    3799</span>              :       }</span>
<span id="L3800"><span class="lineNum">    3800</span>              : </span>
<span id="L3801"><span class="lineNum">    3801</span>              :       __distr_type __d;</span>
<span id="L3802"><span class="lineNum">    3802</span>              : </span>
<span id="L3803"><span class="lineNum">    3803</span>              :       for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)</span>
<span id="L3804"><span class="lineNum">    3804</span>              :         std::iter_swap(__i, __first + __d(__g, __p_type(0, __i - __first)));</span>
<span id="L3805"><span class="lineNum">    3805</span>              :     }</span>
<span id="L3806"><span class="lineNum">    3806</span>              : #endif // USE C99_STDINT</span>
<span id="L3807"><span class="lineNum">    3807</span>              : </span>
<span id="L3808"><span class="lineNum">    3808</span>              : #endif // C++11</span>
<span id="L3809"><span class="lineNum">    3809</span>              : </span>
<span id="L3810"><span class="lineNum">    3810</span>              : _GLIBCXX_BEGIN_NAMESPACE_ALGO</span>
<span id="L3811"><span class="lineNum">    3811</span>              : </span>
<span id="L3812"><span class="lineNum">    3812</span>              :   /**</span>
<span id="L3813"><span class="lineNum">    3813</span>              :    *  @brief Apply a function to every element of a sequence.</span>
<span id="L3814"><span class="lineNum">    3814</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3815"><span class="lineNum">    3815</span>              :    *  @param  __first  An input iterator.</span>
<span id="L3816"><span class="lineNum">    3816</span>              :    *  @param  __last   An input iterator.</span>
<span id="L3817"><span class="lineNum">    3817</span>              :    *  @param  __f      A unary function object.</span>
<span id="L3818"><span class="lineNum">    3818</span>              :    *  @return   @p __f</span>
<span id="L3819"><span class="lineNum">    3819</span>              :    *</span>
<span id="L3820"><span class="lineNum">    3820</span>              :    *  Applies the function object @p __f to each element in the range</span>
<span id="L3821"><span class="lineNum">    3821</span>              :    *  @p [first,last).  @p __f must not modify the order of the sequence.</span>
<span id="L3822"><span class="lineNum">    3822</span>              :    *  If @p __f has a return value it is ignored.</span>
<span id="L3823"><span class="lineNum">    3823</span>              :   */</span>
<span id="L3824"><span class="lineNum">    3824</span>              :   template&lt;typename _InputIterator, typename _Function&gt;</span>
<span id="L3825"><span class="lineNum">    3825</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3826"><span class="lineNum">    3826</span>              :     _Function</span>
<span id="L3827"><span class="lineNum">    3827</span>              :     for_each(_InputIterator __first, _InputIterator __last, _Function __f)</span>
<span id="L3828"><span class="lineNum">    3828</span>              :     {</span>
<span id="L3829"><span class="lineNum">    3829</span>              :       // concept requirements</span>
<span id="L3830"><span class="lineNum">    3830</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3831"><span class="lineNum">    3831</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3832"><span class="lineNum">    3832</span>              :       for (; __first != __last; ++__first)</span>
<span id="L3833"><span class="lineNum">    3833</span>              :         __f(*__first);</span>
<span id="L3834"><span class="lineNum">    3834</span>              :       return __f; // N.B. [alg.foreach] says std::move(f) but it's redundant.</span>
<span id="L3835"><span class="lineNum">    3835</span>              :     }</span>
<span id="L3836"><span class="lineNum">    3836</span>              : </span>
<span id="L3837"><span class="lineNum">    3837</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L3838"><span class="lineNum">    3838</span>              :   /**</span>
<span id="L3839"><span class="lineNum">    3839</span>              :    *  @brief Apply a function to every element of a sequence.</span>
<span id="L3840"><span class="lineNum">    3840</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3841"><span class="lineNum">    3841</span>              :    *  @param  __first  An input iterator.</span>
<span id="L3842"><span class="lineNum">    3842</span>              :    *  @param  __n      A value convertible to an integer.</span>
<span id="L3843"><span class="lineNum">    3843</span>              :    *  @param  __f      A unary function object.</span>
<span id="L3844"><span class="lineNum">    3844</span>              :    *  @return   `__first+__n`</span>
<span id="L3845"><span class="lineNum">    3845</span>              :    *</span>
<span id="L3846"><span class="lineNum">    3846</span>              :    *  Applies the function object `__f` to each element in the range</span>
<span id="L3847"><span class="lineNum">    3847</span>              :    *  `[first, first+n)`.  `__f` must not modify the order of the sequence.</span>
<span id="L3848"><span class="lineNum">    3848</span>              :    *  If `__f` has a return value it is ignored.</span>
<span id="L3849"><span class="lineNum">    3849</span>              :   */</span>
<span id="L3850"><span class="lineNum">    3850</span>              :   template&lt;typename _InputIterator, typename _Size, typename _Function&gt;</span>
<span id="L3851"><span class="lineNum">    3851</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3852"><span class="lineNum">    3852</span>              :     _InputIterator</span>
<span id="L3853"><span class="lineNum">    3853</span>              :     for_each_n(_InputIterator __first, _Size __n, _Function __f)</span>
<span id="L3854"><span class="lineNum">    3854</span>              :     {</span>
<span id="L3855"><span class="lineNum">    3855</span>              :       auto __n2 = std::__size_to_integer(__n);</span>
<span id="L3856"><span class="lineNum">    3856</span>              :       using _Cat = typename iterator_traits&lt;_InputIterator&gt;::iterator_category;</span>
<span id="L3857"><span class="lineNum">    3857</span>              :       if constexpr (is_base_of_v&lt;random_access_iterator_tag, _Cat&gt;)</span>
<span id="L3858"><span class="lineNum">    3858</span>              :         {</span>
<span id="L3859"><span class="lineNum">    3859</span>              :           if (__n2 &lt;= 0)</span>
<span id="L3860"><span class="lineNum">    3860</span>              :             return __first;</span>
<span id="L3861"><span class="lineNum">    3861</span>              :           auto __last = __first + __n2;</span>
<span id="L3862"><span class="lineNum">    3862</span>              :           std::for_each(__first, __last, std::move(__f));</span>
<span id="L3863"><span class="lineNum">    3863</span>              :           return __last;</span>
<span id="L3864"><span class="lineNum">    3864</span>              :         }</span>
<span id="L3865"><span class="lineNum">    3865</span>              :       else</span>
<span id="L3866"><span class="lineNum">    3866</span>              :         {</span>
<span id="L3867"><span class="lineNum">    3867</span>              :           while (__n2--&gt;0)</span>
<span id="L3868"><span class="lineNum">    3868</span>              :             {</span>
<span id="L3869"><span class="lineNum">    3869</span>              :               __f(*__first);</span>
<span id="L3870"><span class="lineNum">    3870</span>              :               ++__first;</span>
<span id="L3871"><span class="lineNum">    3871</span>              :             }</span>
<span id="L3872"><span class="lineNum">    3872</span>              :           return __first;</span>
<span id="L3873"><span class="lineNum">    3873</span>              :         }</span>
<span id="L3874"><span class="lineNum">    3874</span>              :     }</span>
<span id="L3875"><span class="lineNum">    3875</span>              : #endif // C++17</span>
<span id="L3876"><span class="lineNum">    3876</span>              : </span>
<span id="L3877"><span class="lineNum">    3877</span>              :   /**</span>
<span id="L3878"><span class="lineNum">    3878</span>              :    *  @brief Find the first occurrence of a value in a sequence.</span>
<span id="L3879"><span class="lineNum">    3879</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3880"><span class="lineNum">    3880</span>              :    *  @param  __first  An input iterator.</span>
<span id="L3881"><span class="lineNum">    3881</span>              :    *  @param  __last   An input iterator.</span>
<span id="L3882"><span class="lineNum">    3882</span>              :    *  @param  __val    The value to find.</span>
<span id="L3883"><span class="lineNum">    3883</span>              :    *  @return   The first iterator @c i in the range @p [__first,__last)</span>
<span id="L3884"><span class="lineNum">    3884</span>              :    *  such that @c *i == @p __val, or @p __last if no such iterator exists.</span>
<span id="L3885"><span class="lineNum">    3885</span>              :   */</span>
<span id="L3886"><span class="lineNum">    3886</span>              :   template&lt;typename _InputIterator, typename _Tp&gt;</span>
<span id="L3887"><span class="lineNum">    3887</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3888"><span class="lineNum">    3888</span>              :     inline _InputIterator</span>
<span id="L3889"><span class="lineNum">    3889</span>              :     find(_InputIterator __first, _InputIterator __last,</span>
<span id="L3890"><span class="lineNum">    3890</span>              :          const _Tp&amp; __val)</span>
<span id="L3891"><span class="lineNum">    3891</span>              :     {</span>
<span id="L3892"><span class="lineNum">    3892</span>              :       // concept requirements</span>
<span id="L3893"><span class="lineNum">    3893</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3894"><span class="lineNum">    3894</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L3895"><span class="lineNum">    3895</span>              :                 typename iterator_traits&lt;_InputIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L3896"><span class="lineNum">    3896</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3897"><span class="lineNum">    3897</span>              :       return std::__find_if(__first, __last,</span>
<span id="L3898"><span class="lineNum">    3898</span>              :                             __gnu_cxx::__ops::__iter_equals_val(__val));</span>
<span id="L3899"><span class="lineNum">    3899</span>              :     }</span>
<span id="L3900"><span class="lineNum">    3900</span>              : </span>
<span id="L3901"><span class="lineNum">    3901</span>              :   /**</span>
<span id="L3902"><span class="lineNum">    3902</span>              :    *  @brief Find the first element in a sequence for which a</span>
<span id="L3903"><span class="lineNum">    3903</span>              :    *         predicate is true.</span>
<span id="L3904"><span class="lineNum">    3904</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3905"><span class="lineNum">    3905</span>              :    *  @param  __first  An input iterator.</span>
<span id="L3906"><span class="lineNum">    3906</span>              :    *  @param  __last   An input iterator.</span>
<span id="L3907"><span class="lineNum">    3907</span>              :    *  @param  __pred   A predicate.</span>
<span id="L3908"><span class="lineNum">    3908</span>              :    *  @return   The first iterator @c i in the range @p [__first,__last)</span>
<span id="L3909"><span class="lineNum">    3909</span>              :    *  such that @p __pred(*i) is true, or @p __last if no such iterator exists.</span>
<span id="L3910"><span class="lineNum">    3910</span>              :   */</span>
<span id="L3911"><span class="lineNum">    3911</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L3912"><span class="lineNum">    3912</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3913"><span class="lineNum">    3913</span>              :     inline _InputIterator</span>
<span id="L3914"><span class="lineNum">    3914</span>              :     find_if(_InputIterator __first, _InputIterator __last,</span>
<span id="L3915"><span class="lineNum">    3915</span>              :             _Predicate __pred)</span>
<span id="L3916"><span class="lineNum">    3916</span>              :     {</span>
<span id="L3917"><span class="lineNum">    3917</span>              :       // concept requirements</span>
<span id="L3918"><span class="lineNum">    3918</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3919"><span class="lineNum">    3919</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L3920"><span class="lineNum">    3920</span>              :               typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L3921"><span class="lineNum">    3921</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L3922"><span class="lineNum">    3922</span>              : </span>
<span id="L3923"><span class="lineNum">    3923</span>              :       return std::__find_if(__first, __last,</span>
<span id="L3924"><span class="lineNum">    3924</span>              :                             __gnu_cxx::__ops::__pred_iter(__pred));</span>
<span id="L3925"><span class="lineNum">    3925</span>              :     }</span>
<span id="L3926"><span class="lineNum">    3926</span>              : </span>
<span id="L3927"><span class="lineNum">    3927</span>              :   /**</span>
<span id="L3928"><span class="lineNum">    3928</span>              :    *  @brief  Find element from a set in a sequence.</span>
<span id="L3929"><span class="lineNum">    3929</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3930"><span class="lineNum">    3930</span>              :    *  @param  __first1  Start of range to search.</span>
<span id="L3931"><span class="lineNum">    3931</span>              :    *  @param  __last1   End of range to search.</span>
<span id="L3932"><span class="lineNum">    3932</span>              :    *  @param  __first2  Start of match candidates.</span>
<span id="L3933"><span class="lineNum">    3933</span>              :    *  @param  __last2   End of match candidates.</span>
<span id="L3934"><span class="lineNum">    3934</span>              :    *  @return   The first iterator @c i in the range</span>
<span id="L3935"><span class="lineNum">    3935</span>              :    *  @p [__first1,__last1) such that @c *i == @p *(i2) such that i2 is an</span>
<span id="L3936"><span class="lineNum">    3936</span>              :    *  iterator in [__first2,__last2), or @p __last1 if no such iterator exists.</span>
<span id="L3937"><span class="lineNum">    3937</span>              :    *</span>
<span id="L3938"><span class="lineNum">    3938</span>              :    *  Searches the range @p [__first1,__last1) for an element that is</span>
<span id="L3939"><span class="lineNum">    3939</span>              :    *  equal to some element in the range [__first2,__last2).  If</span>
<span id="L3940"><span class="lineNum">    3940</span>              :    *  found, returns an iterator in the range [__first1,__last1),</span>
<span id="L3941"><span class="lineNum">    3941</span>              :    *  otherwise returns @p __last1.</span>
<span id="L3942"><span class="lineNum">    3942</span>              :   */</span>
<span id="L3943"><span class="lineNum">    3943</span>              :   template&lt;typename _InputIterator, typename _ForwardIterator&gt;</span>
<span id="L3944"><span class="lineNum">    3944</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3945"><span class="lineNum">    3945</span>              :     _InputIterator</span>
<span id="L3946"><span class="lineNum">    3946</span>              :     find_first_of(_InputIterator __first1, _InputIterator __last1,</span>
<span id="L3947"><span class="lineNum">    3947</span>              :                   _ForwardIterator __first2, _ForwardIterator __last2)</span>
<span id="L3948"><span class="lineNum">    3948</span>              :     {</span>
<span id="L3949"><span class="lineNum">    3949</span>              :       // concept requirements</span>
<span id="L3950"><span class="lineNum">    3950</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3951"><span class="lineNum">    3951</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3952"><span class="lineNum">    3952</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L3953"><span class="lineNum">    3953</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type,</span>
<span id="L3954"><span class="lineNum">    3954</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3955"><span class="lineNum">    3955</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L3956"><span class="lineNum">    3956</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L3957"><span class="lineNum">    3957</span>              : </span>
<span id="L3958"><span class="lineNum">    3958</span>              :       for (; __first1 != __last1; ++__first1)</span>
<span id="L3959"><span class="lineNum">    3959</span>              :         for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)</span>
<span id="L3960"><span class="lineNum">    3960</span>              :           if (*__first1 == *__iter)</span>
<span id="L3961"><span class="lineNum">    3961</span>              :             return __first1;</span>
<span id="L3962"><span class="lineNum">    3962</span>              :       return __last1;</span>
<span id="L3963"><span class="lineNum">    3963</span>              :     }</span>
<span id="L3964"><span class="lineNum">    3964</span>              : </span>
<span id="L3965"><span class="lineNum">    3965</span>              :   /**</span>
<span id="L3966"><span class="lineNum">    3966</span>              :    *  @brief  Find element from a set in a sequence using a predicate.</span>
<span id="L3967"><span class="lineNum">    3967</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L3968"><span class="lineNum">    3968</span>              :    *  @param  __first1  Start of range to search.</span>
<span id="L3969"><span class="lineNum">    3969</span>              :    *  @param  __last1   End of range to search.</span>
<span id="L3970"><span class="lineNum">    3970</span>              :    *  @param  __first2  Start of match candidates.</span>
<span id="L3971"><span class="lineNum">    3971</span>              :    *  @param  __last2   End of match candidates.</span>
<span id="L3972"><span class="lineNum">    3972</span>              :    *  @param  __comp    Predicate to use.</span>
<span id="L3973"><span class="lineNum">    3973</span>              :    *  @return   The first iterator @c i in the range</span>
<span id="L3974"><span class="lineNum">    3974</span>              :    *  @p [__first1,__last1) such that @c comp(*i, @p *(i2)) is true</span>
<span id="L3975"><span class="lineNum">    3975</span>              :    *  and i2 is an iterator in [__first2,__last2), or @p __last1 if no</span>
<span id="L3976"><span class="lineNum">    3976</span>              :    *  such iterator exists.</span>
<span id="L3977"><span class="lineNum">    3977</span>              :    *</span>
<span id="L3978"><span class="lineNum">    3978</span>              : </span>
<span id="L3979"><span class="lineNum">    3979</span>              :    *  Searches the range @p [__first1,__last1) for an element that is</span>
<span id="L3980"><span class="lineNum">    3980</span>              :    *  equal to some element in the range [__first2,__last2).  If</span>
<span id="L3981"><span class="lineNum">    3981</span>              :    *  found, returns an iterator in the range [__first1,__last1),</span>
<span id="L3982"><span class="lineNum">    3982</span>              :    *  otherwise returns @p __last1.</span>
<span id="L3983"><span class="lineNum">    3983</span>              :   */</span>
<span id="L3984"><span class="lineNum">    3984</span>              :   template&lt;typename _InputIterator, typename _ForwardIterator,</span>
<span id="L3985"><span class="lineNum">    3985</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L3986"><span class="lineNum">    3986</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L3987"><span class="lineNum">    3987</span>              :     _InputIterator</span>
<span id="L3988"><span class="lineNum">    3988</span>              :     find_first_of(_InputIterator __first1, _InputIterator __last1,</span>
<span id="L3989"><span class="lineNum">    3989</span>              :                   _ForwardIterator __first2, _ForwardIterator __last2,</span>
<span id="L3990"><span class="lineNum">    3990</span>              :                   _BinaryPredicate __comp)</span>
<span id="L3991"><span class="lineNum">    3991</span>              :     {</span>
<span id="L3992"><span class="lineNum">    3992</span>              :       // concept requirements</span>
<span id="L3993"><span class="lineNum">    3993</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L3994"><span class="lineNum">    3994</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L3995"><span class="lineNum">    3995</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L3996"><span class="lineNum">    3996</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type,</span>
<span id="L3997"><span class="lineNum">    3997</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L3998"><span class="lineNum">    3998</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L3999"><span class="lineNum">    3999</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L4000"><span class="lineNum">    4000</span>              : </span>
<span id="L4001"><span class="lineNum">    4001</span>              :       for (; __first1 != __last1; ++__first1)</span>
<span id="L4002"><span class="lineNum">    4002</span>              :         for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)</span>
<span id="L4003"><span class="lineNum">    4003</span>              :           if (__comp(*__first1, *__iter))</span>
<span id="L4004"><span class="lineNum">    4004</span>              :             return __first1;</span>
<span id="L4005"><span class="lineNum">    4005</span>              :       return __last1;</span>
<span id="L4006"><span class="lineNum">    4006</span>              :     }</span>
<span id="L4007"><span class="lineNum">    4007</span>              : </span>
<span id="L4008"><span class="lineNum">    4008</span>              :   /**</span>
<span id="L4009"><span class="lineNum">    4009</span>              :    *  @brief Find two adjacent values in a sequence that are equal.</span>
<span id="L4010"><span class="lineNum">    4010</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4011"><span class="lineNum">    4011</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L4012"><span class="lineNum">    4012</span>              :    *  @param  __last   A forward iterator.</span>
<span id="L4013"><span class="lineNum">    4013</span>              :    *  @return   The first iterator @c i such that @c i and @c i+1 are both</span>
<span id="L4014"><span class="lineNum">    4014</span>              :    *  valid iterators in @p [__first,__last) and such that @c *i == @c *(i+1),</span>
<span id="L4015"><span class="lineNum">    4015</span>              :    *  or @p __last if no such iterator exists.</span>
<span id="L4016"><span class="lineNum">    4016</span>              :   */</span>
<span id="L4017"><span class="lineNum">    4017</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L4018"><span class="lineNum">    4018</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4019"><span class="lineNum">    4019</span>              :     inline _ForwardIterator</span>
<span id="L4020"><span class="lineNum">    4020</span>              :     adjacent_find(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L4021"><span class="lineNum">    4021</span>              :     {</span>
<span id="L4022"><span class="lineNum">    4022</span>              :       // concept requirements</span>
<span id="L4023"><span class="lineNum">    4023</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L4024"><span class="lineNum">    4024</span>              :       __glibcxx_function_requires(_EqualityComparableConcept&lt;</span>
<span id="L4025"><span class="lineNum">    4025</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4026"><span class="lineNum">    4026</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4027"><span class="lineNum">    4027</span>              : </span>
<span id="L4028"><span class="lineNum">    4028</span>              :       return std::__adjacent_find(__first, __last,</span>
<span id="L4029"><span class="lineNum">    4029</span>              :                                   __gnu_cxx::__ops::__iter_equal_to_iter());</span>
<span id="L4030"><span class="lineNum">    4030</span>              :     }</span>
<span id="L4031"><span class="lineNum">    4031</span>              : </span>
<span id="L4032"><span class="lineNum">    4032</span>              :   /**</span>
<span id="L4033"><span class="lineNum">    4033</span>              :    *  @brief Find two adjacent values in a sequence using a predicate.</span>
<span id="L4034"><span class="lineNum">    4034</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4035"><span class="lineNum">    4035</span>              :    *  @param  __first         A forward iterator.</span>
<span id="L4036"><span class="lineNum">    4036</span>              :    *  @param  __last          A forward iterator.</span>
<span id="L4037"><span class="lineNum">    4037</span>              :    *  @param  __binary_pred   A binary predicate.</span>
<span id="L4038"><span class="lineNum">    4038</span>              :    *  @return   The first iterator @c i such that @c i and @c i+1 are both</span>
<span id="L4039"><span class="lineNum">    4039</span>              :    *  valid iterators in @p [__first,__last) and such that</span>
<span id="L4040"><span class="lineNum">    4040</span>              :    *  @p __binary_pred(*i,*(i+1)) is true, or @p __last if no such iterator</span>
<span id="L4041"><span class="lineNum">    4041</span>              :    *  exists.</span>
<span id="L4042"><span class="lineNum">    4042</span>              :   */</span>
<span id="L4043"><span class="lineNum">    4043</span>              :   template&lt;typename _ForwardIterator, typename _BinaryPredicate&gt;</span>
<span id="L4044"><span class="lineNum">    4044</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4045"><span class="lineNum">    4045</span>              :     inline _ForwardIterator</span>
<span id="L4046"><span class="lineNum">    4046</span>              :     adjacent_find(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4047"><span class="lineNum">    4047</span>              :                   _BinaryPredicate __binary_pred)</span>
<span id="L4048"><span class="lineNum">    4048</span>              :     {</span>
<span id="L4049"><span class="lineNum">    4049</span>              :       // concept requirements</span>
<span id="L4050"><span class="lineNum">    4050</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L4051"><span class="lineNum">    4051</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L4052"><span class="lineNum">    4052</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L4053"><span class="lineNum">    4053</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4054"><span class="lineNum">    4054</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4055"><span class="lineNum">    4055</span>              : </span>
<span id="L4056"><span class="lineNum">    4056</span>              :       return std::__adjacent_find(__first, __last,</span>
<span id="L4057"><span class="lineNum">    4057</span>              :                         __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));</span>
<span id="L4058"><span class="lineNum">    4058</span>              :     }</span>
<span id="L4059"><span class="lineNum">    4059</span>              : </span>
<span id="L4060"><span class="lineNum">    4060</span>              :   /**</span>
<span id="L4061"><span class="lineNum">    4061</span>              :    *  @brief Count the number of copies of a value in a sequence.</span>
<span id="L4062"><span class="lineNum">    4062</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4063"><span class="lineNum">    4063</span>              :    *  @param  __first  An input iterator.</span>
<span id="L4064"><span class="lineNum">    4064</span>              :    *  @param  __last   An input iterator.</span>
<span id="L4065"><span class="lineNum">    4065</span>              :    *  @param  __value  The value to be counted.</span>
<span id="L4066"><span class="lineNum">    4066</span>              :    *  @return   The number of iterators @c i in the range @p [__first,__last)</span>
<span id="L4067"><span class="lineNum">    4067</span>              :    *  for which @c *i == @p __value</span>
<span id="L4068"><span class="lineNum">    4068</span>              :   */</span>
<span id="L4069"><span class="lineNum">    4069</span>              :   template&lt;typename _InputIterator, typename _Tp&gt;</span>
<span id="L4070"><span class="lineNum">    4070</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4071"><span class="lineNum">    4071</span>              :     inline typename iterator_traits&lt;_InputIterator&gt;::difference_type</span>
<span id="L4072"><span class="lineNum">    4072</span>              :     count(_InputIterator __first, _InputIterator __last, const _Tp&amp; __value)</span>
<span id="L4073"><span class="lineNum">    4073</span>              :     {</span>
<span id="L4074"><span class="lineNum">    4074</span>              :       // concept requirements</span>
<span id="L4075"><span class="lineNum">    4075</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L4076"><span class="lineNum">    4076</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L4077"><span class="lineNum">    4077</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L4078"><span class="lineNum">    4078</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4079"><span class="lineNum">    4079</span>              : </span>
<span id="L4080"><span class="lineNum">    4080</span>              :       return std::__count_if(__first, __last,</span>
<span id="L4081"><span class="lineNum">    4081</span>              :                              __gnu_cxx::__ops::__iter_equals_val(__value));</span>
<span id="L4082"><span class="lineNum">    4082</span>              :     }</span>
<span id="L4083"><span class="lineNum">    4083</span>              : </span>
<span id="L4084"><span class="lineNum">    4084</span>              :   /**</span>
<span id="L4085"><span class="lineNum">    4085</span>              :    *  @brief Count the elements of a sequence for which a predicate is true.</span>
<span id="L4086"><span class="lineNum">    4086</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4087"><span class="lineNum">    4087</span>              :    *  @param  __first  An input iterator.</span>
<span id="L4088"><span class="lineNum">    4088</span>              :    *  @param  __last   An input iterator.</span>
<span id="L4089"><span class="lineNum">    4089</span>              :    *  @param  __pred   A predicate.</span>
<span id="L4090"><span class="lineNum">    4090</span>              :    *  @return   The number of iterators @c i in the range @p [__first,__last)</span>
<span id="L4091"><span class="lineNum">    4091</span>              :    *  for which @p __pred(*i) is true.</span>
<span id="L4092"><span class="lineNum">    4092</span>              :   */</span>
<span id="L4093"><span class="lineNum">    4093</span>              :   template&lt;typename _InputIterator, typename _Predicate&gt;</span>
<span id="L4094"><span class="lineNum">    4094</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4095"><span class="lineNum">    4095</span>              :     inline typename iterator_traits&lt;_InputIterator&gt;::difference_type</span>
<span id="L4096"><span class="lineNum">    4096</span>              :     count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)</span>
<span id="L4097"><span class="lineNum">    4097</span>              :     {</span>
<span id="L4098"><span class="lineNum">    4098</span>              :       // concept requirements</span>
<span id="L4099"><span class="lineNum">    4099</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L4100"><span class="lineNum">    4100</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L4101"><span class="lineNum">    4101</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L4102"><span class="lineNum">    4102</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4103"><span class="lineNum">    4103</span>              : </span>
<span id="L4104"><span class="lineNum">    4104</span>              :       return std::__count_if(__first, __last,</span>
<span id="L4105"><span class="lineNum">    4105</span>              :                              __gnu_cxx::__ops::__pred_iter(__pred));</span>
<span id="L4106"><span class="lineNum">    4106</span>              :     }</span>
<span id="L4107"><span class="lineNum">    4107</span>              : </span>
<span id="L4108"><span class="lineNum">    4108</span>              :   /**</span>
<span id="L4109"><span class="lineNum">    4109</span>              :    *  @brief Search a sequence for a matching sub-sequence.</span>
<span id="L4110"><span class="lineNum">    4110</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4111"><span class="lineNum">    4111</span>              :    *  @param  __first1  A forward iterator.</span>
<span id="L4112"><span class="lineNum">    4112</span>              :    *  @param  __last1   A forward iterator.</span>
<span id="L4113"><span class="lineNum">    4113</span>              :    *  @param  __first2  A forward iterator.</span>
<span id="L4114"><span class="lineNum">    4114</span>              :    *  @param  __last2   A forward iterator.</span>
<span id="L4115"><span class="lineNum">    4115</span>              :    *  @return The first iterator @c i in the range @p</span>
<span id="L4116"><span class="lineNum">    4116</span>              :    *  [__first1,__last1-(__last2-__first2)) such that @c *(i+N) == @p</span>
<span id="L4117"><span class="lineNum">    4117</span>              :    *  *(__first2+N) for each @c N in the range @p</span>
<span id="L4118"><span class="lineNum">    4118</span>              :    *  [0,__last2-__first2), or @p __last1 if no such iterator exists.</span>
<span id="L4119"><span class="lineNum">    4119</span>              :    *</span>
<span id="L4120"><span class="lineNum">    4120</span>              :    *  Searches the range @p [__first1,__last1) for a sub-sequence that</span>
<span id="L4121"><span class="lineNum">    4121</span>              :    *  compares equal value-by-value with the sequence given by @p</span>
<span id="L4122"><span class="lineNum">    4122</span>              :    *  [__first2,__last2) and returns an iterator to the first element</span>
<span id="L4123"><span class="lineNum">    4123</span>              :    *  of the sub-sequence, or @p __last1 if the sub-sequence is not</span>
<span id="L4124"><span class="lineNum">    4124</span>              :    *  found.</span>
<span id="L4125"><span class="lineNum">    4125</span>              :    *</span>
<span id="L4126"><span class="lineNum">    4126</span>              :    *  Because the sub-sequence must lie completely within the range @p</span>
<span id="L4127"><span class="lineNum">    4127</span>              :    *  [__first1,__last1) it must start at a position less than @p</span>
<span id="L4128"><span class="lineNum">    4128</span>              :    *  __last1-(__last2-__first2) where @p __last2-__first2 is the</span>
<span id="L4129"><span class="lineNum">    4129</span>              :    *  length of the sub-sequence.</span>
<span id="L4130"><span class="lineNum">    4130</span>              :    *</span>
<span id="L4131"><span class="lineNum">    4131</span>              :    *  This means that the returned iterator @c i will be in the range</span>
<span id="L4132"><span class="lineNum">    4132</span>              :    *  @p [__first1,__last1-(__last2-__first2))</span>
<span id="L4133"><span class="lineNum">    4133</span>              :   */</span>
<span id="L4134"><span class="lineNum">    4134</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2&gt;</span>
<span id="L4135"><span class="lineNum">    4135</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4136"><span class="lineNum">    4136</span>              :     inline _ForwardIterator1</span>
<span id="L4137"><span class="lineNum">    4137</span>              :     search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L4138"><span class="lineNum">    4138</span>              :            _ForwardIterator2 __first2, _ForwardIterator2 __last2)</span>
<span id="L4139"><span class="lineNum">    4139</span>              :     {</span>
<span id="L4140"><span class="lineNum">    4140</span>              :       // concept requirements</span>
<span id="L4141"><span class="lineNum">    4141</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator1&gt;)</span>
<span id="L4142"><span class="lineNum">    4142</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator2&gt;)</span>
<span id="L4143"><span class="lineNum">    4143</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L4144"><span class="lineNum">    4144</span>              :             typename iterator_traits&lt;_ForwardIterator1&gt;::value_type,</span>
<span id="L4145"><span class="lineNum">    4145</span>              :             typename iterator_traits&lt;_ForwardIterator2&gt;::value_type&gt;)</span>
<span id="L4146"><span class="lineNum">    4146</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L4147"><span class="lineNum">    4147</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L4148"><span class="lineNum">    4148</span>              : </span>
<span id="L4149"><span class="lineNum">    4149</span>              :       return std::__search(__first1, __last1, __first2, __last2,</span>
<span id="L4150"><span class="lineNum">    4150</span>              :                            __gnu_cxx::__ops::__iter_equal_to_iter());</span>
<span id="L4151"><span class="lineNum">    4151</span>              :     }</span>
<span id="L4152"><span class="lineNum">    4152</span>              : </span>
<span id="L4153"><span class="lineNum">    4153</span>              :   /**</span>
<span id="L4154"><span class="lineNum">    4154</span>              :    *  @brief Search a sequence for a matching sub-sequence using a predicate.</span>
<span id="L4155"><span class="lineNum">    4155</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4156"><span class="lineNum">    4156</span>              :    *  @param  __first1     A forward iterator.</span>
<span id="L4157"><span class="lineNum">    4157</span>              :    *  @param  __last1      A forward iterator.</span>
<span id="L4158"><span class="lineNum">    4158</span>              :    *  @param  __first2     A forward iterator.</span>
<span id="L4159"><span class="lineNum">    4159</span>              :    *  @param  __last2      A forward iterator.</span>
<span id="L4160"><span class="lineNum">    4160</span>              :    *  @param  __predicate  A binary predicate.</span>
<span id="L4161"><span class="lineNum">    4161</span>              :    *  @return   The first iterator @c i in the range</span>
<span id="L4162"><span class="lineNum">    4162</span>              :    *  @p [__first1,__last1-(__last2-__first2)) such that</span>
<span id="L4163"><span class="lineNum">    4163</span>              :    *  @p __predicate(*(i+N),*(__first2+N)) is true for each @c N in the range</span>
<span id="L4164"><span class="lineNum">    4164</span>              :    *  @p [0,__last2-__first2), or @p __last1 if no such iterator exists.</span>
<span id="L4165"><span class="lineNum">    4165</span>              :    *</span>
<span id="L4166"><span class="lineNum">    4166</span>              :    *  Searches the range @p [__first1,__last1) for a sub-sequence that</span>
<span id="L4167"><span class="lineNum">    4167</span>              :    *  compares equal value-by-value with the sequence given by @p</span>
<span id="L4168"><span class="lineNum">    4168</span>              :    *  [__first2,__last2), using @p __predicate to determine equality,</span>
<span id="L4169"><span class="lineNum">    4169</span>              :    *  and returns an iterator to the first element of the</span>
<span id="L4170"><span class="lineNum">    4170</span>              :    *  sub-sequence, or @p __last1 if no such iterator exists.</span>
<span id="L4171"><span class="lineNum">    4171</span>              :    *</span>
<span id="L4172"><span class="lineNum">    4172</span>              :    *  @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2)</span>
<span id="L4173"><span class="lineNum">    4173</span>              :   */</span>
<span id="L4174"><span class="lineNum">    4174</span>              :   template&lt;typename _ForwardIterator1, typename _ForwardIterator2,</span>
<span id="L4175"><span class="lineNum">    4175</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L4176"><span class="lineNum">    4176</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4177"><span class="lineNum">    4177</span>              :     inline _ForwardIterator1</span>
<span id="L4178"><span class="lineNum">    4178</span>              :     search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</span>
<span id="L4179"><span class="lineNum">    4179</span>              :            _ForwardIterator2 __first2, _ForwardIterator2 __last2,</span>
<span id="L4180"><span class="lineNum">    4180</span>              :            _BinaryPredicate  __predicate)</span>
<span id="L4181"><span class="lineNum">    4181</span>              :     {</span>
<span id="L4182"><span class="lineNum">    4182</span>              :       // concept requirements</span>
<span id="L4183"><span class="lineNum">    4183</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator1&gt;)</span>
<span id="L4184"><span class="lineNum">    4184</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator2&gt;)</span>
<span id="L4185"><span class="lineNum">    4185</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L4186"><span class="lineNum">    4186</span>              :             typename iterator_traits&lt;_ForwardIterator1&gt;::value_type,</span>
<span id="L4187"><span class="lineNum">    4187</span>              :             typename iterator_traits&lt;_ForwardIterator2&gt;::value_type&gt;)</span>
<span id="L4188"><span class="lineNum">    4188</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L4189"><span class="lineNum">    4189</span>              :       __glibcxx_requires_valid_range(__first2, __last2);</span>
<span id="L4190"><span class="lineNum">    4190</span>              : </span>
<span id="L4191"><span class="lineNum">    4191</span>              :       return std::__search(__first1, __last1, __first2, __last2,</span>
<span id="L4192"><span class="lineNum">    4192</span>              :                            __gnu_cxx::__ops::__iter_comp_iter(__predicate));</span>
<span id="L4193"><span class="lineNum">    4193</span>              :     }</span>
<span id="L4194"><span class="lineNum">    4194</span>              : </span>
<span id="L4195"><span class="lineNum">    4195</span>              :   /**</span>
<span id="L4196"><span class="lineNum">    4196</span>              :    *  @brief Search a sequence for a number of consecutive values.</span>
<span id="L4197"><span class="lineNum">    4197</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4198"><span class="lineNum">    4198</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L4199"><span class="lineNum">    4199</span>              :    *  @param  __last   A forward iterator.</span>
<span id="L4200"><span class="lineNum">    4200</span>              :    *  @param  __count  The number of consecutive values.</span>
<span id="L4201"><span class="lineNum">    4201</span>              :    *  @param  __val    The value to find.</span>
<span id="L4202"><span class="lineNum">    4202</span>              :    *  @return The first iterator @c i in the range @p</span>
<span id="L4203"><span class="lineNum">    4203</span>              :    *  [__first,__last-__count) such that @c *(i+N) == @p __val for</span>
<span id="L4204"><span class="lineNum">    4204</span>              :    *  each @c N in the range @p [0,__count), or @p __last if no such</span>
<span id="L4205"><span class="lineNum">    4205</span>              :    *  iterator exists.</span>
<span id="L4206"><span class="lineNum">    4206</span>              :    *</span>
<span id="L4207"><span class="lineNum">    4207</span>              :    *  Searches the range @p [__first,__last) for @p count consecutive elements</span>
<span id="L4208"><span class="lineNum">    4208</span>              :    *  equal to @p __val.</span>
<span id="L4209"><span class="lineNum">    4209</span>              :   */</span>
<span id="L4210"><span class="lineNum">    4210</span>              :   template&lt;typename _ForwardIterator, typename _Integer, typename _Tp&gt;</span>
<span id="L4211"><span class="lineNum">    4211</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4212"><span class="lineNum">    4212</span>              :     inline _ForwardIterator</span>
<span id="L4213"><span class="lineNum">    4213</span>              :     search_n(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4214"><span class="lineNum">    4214</span>              :              _Integer __count, const _Tp&amp; __val)</span>
<span id="L4215"><span class="lineNum">    4215</span>              :     {</span>
<span id="L4216"><span class="lineNum">    4216</span>              :       // concept requirements</span>
<span id="L4217"><span class="lineNum">    4217</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L4218"><span class="lineNum">    4218</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L4219"><span class="lineNum">    4219</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L4220"><span class="lineNum">    4220</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4221"><span class="lineNum">    4221</span>              : </span>
<span id="L4222"><span class="lineNum">    4222</span>              :       return std::__search_n(__first, __last, __count,</span>
<span id="L4223"><span class="lineNum">    4223</span>              :                              __gnu_cxx::__ops::__iter_equals_val(__val));</span>
<span id="L4224"><span class="lineNum">    4224</span>              :     }</span>
<span id="L4225"><span class="lineNum">    4225</span>              : </span>
<span id="L4226"><span class="lineNum">    4226</span>              : </span>
<span id="L4227"><span class="lineNum">    4227</span>              :   /**</span>
<span id="L4228"><span class="lineNum">    4228</span>              :    *  @brief Search a sequence for a number of consecutive values using a</span>
<span id="L4229"><span class="lineNum">    4229</span>              :    *         predicate.</span>
<span id="L4230"><span class="lineNum">    4230</span>              :    *  @ingroup non_mutating_algorithms</span>
<span id="L4231"><span class="lineNum">    4231</span>              :    *  @param  __first        A forward iterator.</span>
<span id="L4232"><span class="lineNum">    4232</span>              :    *  @param  __last         A forward iterator.</span>
<span id="L4233"><span class="lineNum">    4233</span>              :    *  @param  __count        The number of consecutive values.</span>
<span id="L4234"><span class="lineNum">    4234</span>              :    *  @param  __val          The value to find.</span>
<span id="L4235"><span class="lineNum">    4235</span>              :    *  @param  __binary_pred  A binary predicate.</span>
<span id="L4236"><span class="lineNum">    4236</span>              :    *  @return The first iterator @c i in the range @p</span>
<span id="L4237"><span class="lineNum">    4237</span>              :    *  [__first,__last-__count) such that @p</span>
<span id="L4238"><span class="lineNum">    4238</span>              :    *  __binary_pred(*(i+N),__val) is true for each @c N in the range</span>
<span id="L4239"><span class="lineNum">    4239</span>              :    *  @p [0,__count), or @p __last if no such iterator exists.</span>
<span id="L4240"><span class="lineNum">    4240</span>              :    *</span>
<span id="L4241"><span class="lineNum">    4241</span>              :    *  Searches the range @p [__first,__last) for @p __count</span>
<span id="L4242"><span class="lineNum">    4242</span>              :    *  consecutive elements for which the predicate returns true.</span>
<span id="L4243"><span class="lineNum">    4243</span>              :   */</span>
<span id="L4244"><span class="lineNum">    4244</span>              :   template&lt;typename _ForwardIterator, typename _Integer, typename _Tp,</span>
<span id="L4245"><span class="lineNum">    4245</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L4246"><span class="lineNum">    4246</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4247"><span class="lineNum">    4247</span>              :     inline _ForwardIterator</span>
<span id="L4248"><span class="lineNum">    4248</span>              :     search_n(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4249"><span class="lineNum">    4249</span>              :              _Integer __count, const _Tp&amp; __val,</span>
<span id="L4250"><span class="lineNum">    4250</span>              :              _BinaryPredicate __binary_pred)</span>
<span id="L4251"><span class="lineNum">    4251</span>              :     {</span>
<span id="L4252"><span class="lineNum">    4252</span>              :       // concept requirements</span>
<span id="L4253"><span class="lineNum">    4253</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L4254"><span class="lineNum">    4254</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_BinaryPredicate,</span>
<span id="L4255"><span class="lineNum">    4255</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L4256"><span class="lineNum">    4256</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4257"><span class="lineNum">    4257</span>              : </span>
<span id="L4258"><span class="lineNum">    4258</span>              :       return std::__search_n(__first, __last, __count,</span>
<span id="L4259"><span class="lineNum">    4259</span>              :                 __gnu_cxx::__ops::__iter_comp_val(__binary_pred, __val));</span>
<span id="L4260"><span class="lineNum">    4260</span>              :     }</span>
<span id="L4261"><span class="lineNum">    4261</span>              : </span>
<span id="L4262"><span class="lineNum">    4262</span>              : #if __cplusplus &gt;= 201703L</span>
<span id="L4263"><span class="lineNum">    4263</span>              :   /** @brief Search a sequence using a Searcher object.</span>
<span id="L4264"><span class="lineNum">    4264</span>              :    *</span>
<span id="L4265"><span class="lineNum">    4265</span>              :    *  @param  __first        A forward iterator.</span>
<span id="L4266"><span class="lineNum">    4266</span>              :    *  @param  __last         A forward iterator.</span>
<span id="L4267"><span class="lineNum">    4267</span>              :    *  @param  __searcher     A callable object.</span>
<span id="L4268"><span class="lineNum">    4268</span>              :    *  @return @p __searcher(__first,__last).first</span>
<span id="L4269"><span class="lineNum">    4269</span>              :   */</span>
<span id="L4270"><span class="lineNum">    4270</span>              :   template&lt;typename _ForwardIterator, typename _Searcher&gt;</span>
<span id="L4271"><span class="lineNum">    4271</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4272"><span class="lineNum">    4272</span>              :     inline _ForwardIterator</span>
<span id="L4273"><span class="lineNum">    4273</span>              :     search(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4274"><span class="lineNum">    4274</span>              :            const _Searcher&amp; __searcher)</span>
<span id="L4275"><span class="lineNum">    4275</span>              :     { return __searcher(__first, __last).first; }</span>
<span id="L4276"><span class="lineNum">    4276</span>              : #endif</span>
<span id="L4277"><span class="lineNum">    4277</span>              : </span>
<span id="L4278"><span class="lineNum">    4278</span>              :   /**</span>
<span id="L4279"><span class="lineNum">    4279</span>              :    *  @brief Perform an operation on a sequence.</span>
<span id="L4280"><span class="lineNum">    4280</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4281"><span class="lineNum">    4281</span>              :    *  @param  __first     An input iterator.</span>
<span id="L4282"><span class="lineNum">    4282</span>              :    *  @param  __last      An input iterator.</span>
<span id="L4283"><span class="lineNum">    4283</span>              :    *  @param  __result    An output iterator.</span>
<span id="L4284"><span class="lineNum">    4284</span>              :    *  @param  __unary_op  A unary operator.</span>
<span id="L4285"><span class="lineNum">    4285</span>              :    *  @return   An output iterator equal to @p __result+(__last-__first).</span>
<span id="L4286"><span class="lineNum">    4286</span>              :    *</span>
<span id="L4287"><span class="lineNum">    4287</span>              :    *  Applies the operator to each element in the input range and assigns</span>
<span id="L4288"><span class="lineNum">    4288</span>              :    *  the results to successive elements of the output sequence.</span>
<span id="L4289"><span class="lineNum">    4289</span>              :    *  Evaluates @p *(__result+N)=unary_op(*(__first+N)) for each @c N in the</span>
<span id="L4290"><span class="lineNum">    4290</span>              :    *  range @p [0,__last-__first).</span>
<span id="L4291"><span class="lineNum">    4291</span>              :    *</span>
<span id="L4292"><span class="lineNum">    4292</span>              :    *  @p unary_op must not alter its argument.</span>
<span id="L4293"><span class="lineNum">    4293</span>              :   */</span>
<span id="L4294"><span class="lineNum">    4294</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L4295"><span class="lineNum">    4295</span>              :            typename _UnaryOperation&gt;</span>
<span id="L4296"><span class="lineNum">    4296</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4297"><span class="lineNum">    4297</span>              :     _OutputIterator</span>
<span id="L4298"><span class="lineNum">    4298</span>              :     transform(_InputIterator __first, _InputIterator __last,</span>
<span id="L4299"><span class="lineNum">    4299</span>              :               _OutputIterator __result, _UnaryOperation __unary_op)</span>
<span id="L4300"><span class="lineNum">    4300</span>              :     {</span>
<span id="L4301"><span class="lineNum">    4301</span>              :       // concept requirements</span>
<span id="L4302"><span class="lineNum">    4302</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L4303"><span class="lineNum">    4303</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4304"><span class="lineNum">    4304</span>              :             // &quot;the type returned by a _UnaryOperation&quot;</span>
<span id="L4305"><span class="lineNum">    4305</span>              :             __typeof__(__unary_op(*__first))&gt;)</span>
<span id="L4306"><span class="lineNum">    4306</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4307"><span class="lineNum">    4307</span>              : </span>
<span id="L4308"><span class="lineNum">    4308</span>              :       for (; __first != __last; ++__first, (void)++__result)</span>
<span id="L4309"><span class="lineNum">    4309</span>              :         *__result = __unary_op(*__first);</span>
<span id="L4310"><span class="lineNum">    4310</span>              :       return __result;</span>
<span id="L4311"><span class="lineNum">    4311</span>              :     }</span>
<span id="L4312"><span class="lineNum">    4312</span>              : </span>
<span id="L4313"><span class="lineNum">    4313</span>              :   /**</span>
<span id="L4314"><span class="lineNum">    4314</span>              :    *  @brief Perform an operation on corresponding elements of two sequences.</span>
<span id="L4315"><span class="lineNum">    4315</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4316"><span class="lineNum">    4316</span>              :    *  @param  __first1     An input iterator.</span>
<span id="L4317"><span class="lineNum">    4317</span>              :    *  @param  __last1      An input iterator.</span>
<span id="L4318"><span class="lineNum">    4318</span>              :    *  @param  __first2     An input iterator.</span>
<span id="L4319"><span class="lineNum">    4319</span>              :    *  @param  __result     An output iterator.</span>
<span id="L4320"><span class="lineNum">    4320</span>              :    *  @param  __binary_op  A binary operator.</span>
<span id="L4321"><span class="lineNum">    4321</span>              :    *  @return   An output iterator equal to @p result+(last-first).</span>
<span id="L4322"><span class="lineNum">    4322</span>              :    *</span>
<span id="L4323"><span class="lineNum">    4323</span>              :    *  Applies the operator to the corresponding elements in the two</span>
<span id="L4324"><span class="lineNum">    4324</span>              :    *  input ranges and assigns the results to successive elements of the</span>
<span id="L4325"><span class="lineNum">    4325</span>              :    *  output sequence.</span>
<span id="L4326"><span class="lineNum">    4326</span>              :    *  Evaluates @p</span>
<span id="L4327"><span class="lineNum">    4327</span>              :    *  *(__result+N)=__binary_op(*(__first1+N),*(__first2+N)) for each</span>
<span id="L4328"><span class="lineNum">    4328</span>              :    *  @c N in the range @p [0,__last1-__first1).</span>
<span id="L4329"><span class="lineNum">    4329</span>              :    *</span>
<span id="L4330"><span class="lineNum">    4330</span>              :    *  @p binary_op must not alter either of its arguments.</span>
<span id="L4331"><span class="lineNum">    4331</span>              :   */</span>
<span id="L4332"><span class="lineNum">    4332</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L4333"><span class="lineNum">    4333</span>              :            typename _OutputIterator, typename _BinaryOperation&gt;</span>
<span id="L4334"><span class="lineNum">    4334</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4335"><span class="lineNum">    4335</span>              :     _OutputIterator</span>
<span id="L4336"><span class="lineNum">    4336</span>              :     transform(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L4337"><span class="lineNum">    4337</span>              :               _InputIterator2 __first2, _OutputIterator __result,</span>
<span id="L4338"><span class="lineNum">    4338</span>              :               _BinaryOperation __binary_op)</span>
<span id="L4339"><span class="lineNum">    4339</span>              :     {</span>
<span id="L4340"><span class="lineNum">    4340</span>              :       // concept requirements</span>
<span id="L4341"><span class="lineNum">    4341</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L4342"><span class="lineNum">    4342</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L4343"><span class="lineNum">    4343</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4344"><span class="lineNum">    4344</span>              :             // &quot;the type returned by a _BinaryOperation&quot;</span>
<span id="L4345"><span class="lineNum">    4345</span>              :             __typeof__(__binary_op(*__first1,*__first2))&gt;)</span>
<span id="L4346"><span class="lineNum">    4346</span>              :       __glibcxx_requires_valid_range(__first1, __last1);</span>
<span id="L4347"><span class="lineNum">    4347</span>              : </span>
<span id="L4348"><span class="lineNum">    4348</span>              :       for (; __first1 != __last1; ++__first1, (void)++__first2, ++__result)</span>
<span id="L4349"><span class="lineNum">    4349</span>              :         *__result = __binary_op(*__first1, *__first2);</span>
<span id="L4350"><span class="lineNum">    4350</span>              :       return __result;</span>
<span id="L4351"><span class="lineNum">    4351</span>              :     }</span>
<span id="L4352"><span class="lineNum">    4352</span>              : </span>
<span id="L4353"><span class="lineNum">    4353</span>              :   /**</span>
<span id="L4354"><span class="lineNum">    4354</span>              :    *  @brief Replace each occurrence of one value in a sequence with another</span>
<span id="L4355"><span class="lineNum">    4355</span>              :    *         value.</span>
<span id="L4356"><span class="lineNum">    4356</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4357"><span class="lineNum">    4357</span>              :    *  @param  __first      A forward iterator.</span>
<span id="L4358"><span class="lineNum">    4358</span>              :    *  @param  __last       A forward iterator.</span>
<span id="L4359"><span class="lineNum">    4359</span>              :    *  @param  __old_value  The value to be replaced.</span>
<span id="L4360"><span class="lineNum">    4360</span>              :    *  @param  __new_value  The replacement value.</span>
<span id="L4361"><span class="lineNum">    4361</span>              :    *  @return   replace() returns no value.</span>
<span id="L4362"><span class="lineNum">    4362</span>              :    *</span>
<span id="L4363"><span class="lineNum">    4363</span>              :    *  For each iterator `i` in the range `[__first,__last)` if</span>
<span id="L4364"><span class="lineNum">    4364</span>              :    *  `*i == __old_value` then the assignment `*i = __new_value` is performed.</span>
<span id="L4365"><span class="lineNum">    4365</span>              :   */</span>
<span id="L4366"><span class="lineNum">    4366</span>              :   template&lt;typename _ForwardIterator, typename _Tp&gt;</span>
<span id="L4367"><span class="lineNum">    4367</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4368"><span class="lineNum">    4368</span>              :     void</span>
<span id="L4369"><span class="lineNum">    4369</span>              :     replace(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4370"><span class="lineNum">    4370</span>              :             const _Tp&amp; __old_value, const _Tp&amp; __new_value)</span>
<span id="L4371"><span class="lineNum">    4371</span>              :     {</span>
<span id="L4372"><span class="lineNum">    4372</span>              :       // concept requirements</span>
<span id="L4373"><span class="lineNum">    4373</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L4374"><span class="lineNum">    4374</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L4375"><span class="lineNum">    4375</span>              :       __glibcxx_function_requires(_EqualOpConcept&lt;</span>
<span id="L4376"><span class="lineNum">    4376</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type, _Tp&gt;)</span>
<span id="L4377"><span class="lineNum">    4377</span>              :       __glibcxx_function_requires(_ConvertibleConcept&lt;_Tp,</span>
<span id="L4378"><span class="lineNum">    4378</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4379"><span class="lineNum">    4379</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4380"><span class="lineNum">    4380</span>              : </span>
<span id="L4381"><span class="lineNum">    4381</span>              :       for (; __first != __last; ++__first)</span>
<span id="L4382"><span class="lineNum">    4382</span>              :         if (*__first == __old_value)</span>
<span id="L4383"><span class="lineNum">    4383</span>              :           *__first = __new_value;</span>
<span id="L4384"><span class="lineNum">    4384</span>              :     }</span>
<span id="L4385"><span class="lineNum">    4385</span>              : </span>
<span id="L4386"><span class="lineNum">    4386</span>              :   /**</span>
<span id="L4387"><span class="lineNum">    4387</span>              :    *  @brief Replace each value in a sequence for which a predicate returns</span>
<span id="L4388"><span class="lineNum">    4388</span>              :    *         true with another value.</span>
<span id="L4389"><span class="lineNum">    4389</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4390"><span class="lineNum">    4390</span>              :    *  @param  __first      A forward iterator.</span>
<span id="L4391"><span class="lineNum">    4391</span>              :    *  @param  __last       A forward iterator.</span>
<span id="L4392"><span class="lineNum">    4392</span>              :    *  @param  __pred       A predicate.</span>
<span id="L4393"><span class="lineNum">    4393</span>              :    *  @param  __new_value  The replacement value.</span>
<span id="L4394"><span class="lineNum">    4394</span>              :    *  @return   replace_if() returns no value.</span>
<span id="L4395"><span class="lineNum">    4395</span>              :    *</span>
<span id="L4396"><span class="lineNum">    4396</span>              :    *  For each iterator `i` in the range `[__first,__last)` if `__pred(*i)`</span>
<span id="L4397"><span class="lineNum">    4397</span>              :    *  is true then the assignment `*i = __new_value` is performed.</span>
<span id="L4398"><span class="lineNum">    4398</span>              :   */</span>
<span id="L4399"><span class="lineNum">    4399</span>              :   template&lt;typename _ForwardIterator, typename _Predicate, typename _Tp&gt;</span>
<span id="L4400"><span class="lineNum">    4400</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4401"><span class="lineNum">    4401</span>              :     void</span>
<span id="L4402"><span class="lineNum">    4402</span>              :     replace_if(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4403"><span class="lineNum">    4403</span>              :                _Predicate __pred, const _Tp&amp; __new_value)</span>
<span id="L4404"><span class="lineNum">    4404</span>              :     {</span>
<span id="L4405"><span class="lineNum">    4405</span>              :       // concept requirements</span>
<span id="L4406"><span class="lineNum">    4406</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L4407"><span class="lineNum">    4407</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L4408"><span class="lineNum">    4408</span>              :       __glibcxx_function_requires(_ConvertibleConcept&lt;_Tp,</span>
<span id="L4409"><span class="lineNum">    4409</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4410"><span class="lineNum">    4410</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L4411"><span class="lineNum">    4411</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4412"><span class="lineNum">    4412</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4413"><span class="lineNum">    4413</span>              : </span>
<span id="L4414"><span class="lineNum">    4414</span>              :       for (; __first != __last; ++__first)</span>
<span id="L4415"><span class="lineNum">    4415</span>              :         if (__pred(*__first))</span>
<span id="L4416"><span class="lineNum">    4416</span>              :           *__first = __new_value;</span>
<span id="L4417"><span class="lineNum">    4417</span>              :     }</span>
<span id="L4418"><span class="lineNum">    4418</span>              : </span>
<span id="L4419"><span class="lineNum">    4419</span>              :   /**</span>
<span id="L4420"><span class="lineNum">    4420</span>              :    *  @brief Assign the result of a function object to each value in a</span>
<span id="L4421"><span class="lineNum">    4421</span>              :    *         sequence.</span>
<span id="L4422"><span class="lineNum">    4422</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4423"><span class="lineNum">    4423</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L4424"><span class="lineNum">    4424</span>              :    *  @param  __last   A forward iterator.</span>
<span id="L4425"><span class="lineNum">    4425</span>              :    *  @param  __gen    A function object callable with no arguments.</span>
<span id="L4426"><span class="lineNum">    4426</span>              :    *  @return   generate() returns no value.</span>
<span id="L4427"><span class="lineNum">    4427</span>              :    *</span>
<span id="L4428"><span class="lineNum">    4428</span>              :    *  Performs the assignment `*i = __gen()` for each `i` in the range</span>
<span id="L4429"><span class="lineNum">    4429</span>              :    *  `[__first, __last)`.</span>
<span id="L4430"><span class="lineNum">    4430</span>              :   */</span>
<span id="L4431"><span class="lineNum">    4431</span>              :   template&lt;typename _ForwardIterator, typename _Generator&gt;</span>
<span id="L4432"><span class="lineNum">    4432</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4433"><span class="lineNum">    4433</span>              :     void</span>
<span id="L4434"><span class="lineNum">    4434</span>              :     generate(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4435"><span class="lineNum">    4435</span>              :              _Generator __gen)</span>
<span id="L4436"><span class="lineNum">    4436</span>              :     {</span>
<span id="L4437"><span class="lineNum">    4437</span>              :       // concept requirements</span>
<span id="L4438"><span class="lineNum">    4438</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L4439"><span class="lineNum">    4439</span>              :       __glibcxx_function_requires(_GeneratorConcept&lt;_Generator,</span>
<span id="L4440"><span class="lineNum">    4440</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4441"><span class="lineNum">    4441</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4442"><span class="lineNum">    4442</span>              : </span>
<span id="L4443"><span class="lineNum">    4443</span>              :       for (; __first != __last; ++__first)</span>
<span id="L4444"><span class="lineNum">    4444</span>              :         *__first = __gen();</span>
<span id="L4445"><span class="lineNum">    4445</span>              :     }</span>
<span id="L4446"><span class="lineNum">    4446</span>              : </span>
<span id="L4447"><span class="lineNum">    4447</span>              :   /**</span>
<span id="L4448"><span class="lineNum">    4448</span>              :    *  @brief Assign the result of a function object to each value in a</span>
<span id="L4449"><span class="lineNum">    4449</span>              :    *         sequence.</span>
<span id="L4450"><span class="lineNum">    4450</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4451"><span class="lineNum">    4451</span>              :    *  @param  __first  A forward iterator.</span>
<span id="L4452"><span class="lineNum">    4452</span>              :    *  @param  __n      The length of the sequence.</span>
<span id="L4453"><span class="lineNum">    4453</span>              :    *  @param  __gen    A function object callable with no arguments.</span>
<span id="L4454"><span class="lineNum">    4454</span>              :    *  @return   The end of the sequence, i.e., `__first + __n`</span>
<span id="L4455"><span class="lineNum">    4455</span>              :    *</span>
<span id="L4456"><span class="lineNum">    4456</span>              :    *  Performs the assignment `*i = __gen()` for each `i` in the range</span>
<span id="L4457"><span class="lineNum">    4457</span>              :    *  `[__first, __first + __n)`.</span>
<span id="L4458"><span class="lineNum">    4458</span>              :    *</span>
<span id="L4459"><span class="lineNum">    4459</span>              :    * If `__n` is negative, the function does nothing and returns `__first`.</span>
<span id="L4460"><span class="lineNum">    4460</span>              :   */</span>
<span id="L4461"><span class="lineNum">    4461</span>              :   // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L4462"><span class="lineNum">    4462</span>              :   // DR 865. More algorithms that throw away information</span>
<span id="L4463"><span class="lineNum">    4463</span>              :   // DR 426. search_n(), fill_n(), and generate_n() with negative n</span>
<span id="L4464"><span class="lineNum">    4464</span>              :   template&lt;typename _OutputIterator, typename _Size, typename _Generator&gt;</span>
<span id="L4465"><span class="lineNum">    4465</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4466"><span class="lineNum">    4466</span>              :     _OutputIterator</span>
<span id="L4467"><span class="lineNum">    4467</span>              :     generate_n(_OutputIterator __first, _Size __n, _Generator __gen)</span>
<span id="L4468"><span class="lineNum">    4468</span>              :     {</span>
<span id="L4469"><span class="lineNum">    4469</span>              :       // concept requirements</span>
<span id="L4470"><span class="lineNum">    4470</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4471"><span class="lineNum">    4471</span>              :             // &quot;the type returned by a _Generator&quot;</span>
<span id="L4472"><span class="lineNum">    4472</span>              :             __typeof__(__gen())&gt;)</span>
<span id="L4473"><span class="lineNum">    4473</span>              : </span>
<span id="L4474"><span class="lineNum">    4474</span>              :       typedef __decltype(std::__size_to_integer(__n)) _IntSize;</span>
<span id="L4475"><span class="lineNum">    4475</span>              :       for (_IntSize __niter = std::__size_to_integer(__n);</span>
<span id="L4476"><span class="lineNum">    4476</span>              :            __niter &gt; 0; --__niter, (void) ++__first)</span>
<span id="L4477"><span class="lineNum">    4477</span>              :         *__first = __gen();</span>
<span id="L4478"><span class="lineNum">    4478</span>              :       return __first;</span>
<span id="L4479"><span class="lineNum">    4479</span>              :     }</span>
<span id="L4480"><span class="lineNum">    4480</span>              : </span>
<span id="L4481"><span class="lineNum">    4481</span>              :   /**</span>
<span id="L4482"><span class="lineNum">    4482</span>              :    *  @brief Copy a sequence, removing consecutive duplicate values.</span>
<span id="L4483"><span class="lineNum">    4483</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4484"><span class="lineNum">    4484</span>              :    *  @param  __first   An input iterator.</span>
<span id="L4485"><span class="lineNum">    4485</span>              :    *  @param  __last    An input iterator.</span>
<span id="L4486"><span class="lineNum">    4486</span>              :    *  @param  __result  An output iterator.</span>
<span id="L4487"><span class="lineNum">    4487</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L4488"><span class="lineNum">    4488</span>              :    *</span>
<span id="L4489"><span class="lineNum">    4489</span>              :    *  Copies each element in the range `[__first, __last)` to the range</span>
<span id="L4490"><span class="lineNum">    4490</span>              :    *  beginning at `__result`, except that only the first element is copied</span>
<span id="L4491"><span class="lineNum">    4491</span>              :    *  from groups of consecutive elements that compare equal.</span>
<span id="L4492"><span class="lineNum">    4492</span>              :    *  `unique_copy()` is stable, so the relative order of elements that are</span>
<span id="L4493"><span class="lineNum">    4493</span>              :    *  copied is unchanged.</span>
<span id="L4494"><span class="lineNum">    4494</span>              :    */</span>
<span id="L4495"><span class="lineNum">    4495</span>              :   // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L4496"><span class="lineNum">    4496</span>              :   // DR 241. Does unique_copy() require CopyConstructible and Assignable?</span>
<span id="L4497"><span class="lineNum">    4497</span>              :   // DR 538. 241 again: Does unique_copy() require CopyConstructible and</span>
<span id="L4498"><span class="lineNum">    4498</span>              :   // Assignable?</span>
<span id="L4499"><span class="lineNum">    4499</span>              :   template&lt;typename _InputIterator, typename _OutputIterator&gt;</span>
<span id="L4500"><span class="lineNum">    4500</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4501"><span class="lineNum">    4501</span>              :     inline _OutputIterator</span>
<span id="L4502"><span class="lineNum">    4502</span>              :     unique_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L4503"><span class="lineNum">    4503</span>              :                 _OutputIterator __result)</span>
<span id="L4504"><span class="lineNum">    4504</span>              :     {</span>
<span id="L4505"><span class="lineNum">    4505</span>              :       // concept requirements</span>
<span id="L4506"><span class="lineNum">    4506</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L4507"><span class="lineNum">    4507</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4508"><span class="lineNum">    4508</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L4509"><span class="lineNum">    4509</span>              :       __glibcxx_function_requires(_EqualityComparableConcept&lt;</span>
<span id="L4510"><span class="lineNum">    4510</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L4511"><span class="lineNum">    4511</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4512"><span class="lineNum">    4512</span>              : </span>
<span id="L4513"><span class="lineNum">    4513</span>              :       if (__first == __last)</span>
<span id="L4514"><span class="lineNum">    4514</span>              :         return __result;</span>
<span id="L4515"><span class="lineNum">    4515</span>              :       return std::__unique_copy(__first, __last, __result,</span>
<span id="L4516"><span class="lineNum">    4516</span>              :                                 __gnu_cxx::__ops::__iter_equal_to_iter(),</span>
<span id="L4517"><span class="lineNum">    4517</span>              :                                 std::__iterator_category(__first),</span>
<span id="L4518"><span class="lineNum">    4518</span>              :                                 std::__iterator_category(__result));</span>
<span id="L4519"><span class="lineNum">    4519</span>              :     }</span>
<span id="L4520"><span class="lineNum">    4520</span>              : </span>
<span id="L4521"><span class="lineNum">    4521</span>              :   /**</span>
<span id="L4522"><span class="lineNum">    4522</span>              :    *  @brief Copy a sequence, removing consecutive values using a predicate.</span>
<span id="L4523"><span class="lineNum">    4523</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4524"><span class="lineNum">    4524</span>              :    *  @param  __first        An input iterator.</span>
<span id="L4525"><span class="lineNum">    4525</span>              :    *  @param  __last         An input iterator.</span>
<span id="L4526"><span class="lineNum">    4526</span>              :    *  @param  __result       An output iterator.</span>
<span id="L4527"><span class="lineNum">    4527</span>              :    *  @param  __binary_pred  A binary predicate.</span>
<span id="L4528"><span class="lineNum">    4528</span>              :    *  @return   An iterator designating the end of the resulting sequence.</span>
<span id="L4529"><span class="lineNum">    4529</span>              :    *</span>
<span id="L4530"><span class="lineNum">    4530</span>              :    *  Copies each element in the range `[__first, __last)` to the range</span>
<span id="L4531"><span class="lineNum">    4531</span>              :    *  beginning at `__result`, except that only the first element is copied</span>
<span id="L4532"><span class="lineNum">    4532</span>              :    *  from groups of consecutive elements for which `__binary_pred` returns</span>
<span id="L4533"><span class="lineNum">    4533</span>              :    *  true.</span>
<span id="L4534"><span class="lineNum">    4534</span>              :    *  `unique_copy()` is stable, so the relative order of elements that are</span>
<span id="L4535"><span class="lineNum">    4535</span>              :    *  copied is unchanged.</span>
<span id="L4536"><span class="lineNum">    4536</span>              :    */</span>
<span id="L4537"><span class="lineNum">    4537</span>              :   // _GLIBCXX_RESOLVE_LIB_DEFECTS</span>
<span id="L4538"><span class="lineNum">    4538</span>              :   // DR 241. Does unique_copy() require CopyConstructible and Assignable?</span>
<span id="L4539"><span class="lineNum">    4539</span>              :   template&lt;typename _InputIterator, typename _OutputIterator,</span>
<span id="L4540"><span class="lineNum">    4540</span>              :            typename _BinaryPredicate&gt;</span>
<span id="L4541"><span class="lineNum">    4541</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4542"><span class="lineNum">    4542</span>              :     inline _OutputIterator</span>
<span id="L4543"><span class="lineNum">    4543</span>              :     unique_copy(_InputIterator __first, _InputIterator __last,</span>
<span id="L4544"><span class="lineNum">    4544</span>              :                 _OutputIterator __result,</span>
<span id="L4545"><span class="lineNum">    4545</span>              :                 _BinaryPredicate __binary_pred)</span>
<span id="L4546"><span class="lineNum">    4546</span>              :     {</span>
<span id="L4547"><span class="lineNum">    4547</span>              :       // concept requirements -- predicates checked later</span>
<span id="L4548"><span class="lineNum">    4548</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator&gt;)</span>
<span id="L4549"><span class="lineNum">    4549</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4550"><span class="lineNum">    4550</span>              :             typename iterator_traits&lt;_InputIterator&gt;::value_type&gt;)</span>
<span id="L4551"><span class="lineNum">    4551</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4552"><span class="lineNum">    4552</span>              : </span>
<span id="L4553"><span class="lineNum">    4553</span>              :       if (__first == __last)</span>
<span id="L4554"><span class="lineNum">    4554</span>              :         return __result;</span>
<span id="L4555"><span class="lineNum">    4555</span>              :       return std::__unique_copy(__first, __last, __result,</span>
<span id="L4556"><span class="lineNum">    4556</span>              :                         __gnu_cxx::__ops::__iter_comp_iter(__binary_pred),</span>
<span id="L4557"><span class="lineNum">    4557</span>              :                                 std::__iterator_category(__first),</span>
<span id="L4558"><span class="lineNum">    4558</span>              :                                 std::__iterator_category(__result));</span>
<span id="L4559"><span class="lineNum">    4559</span>              :     }</span>
<span id="L4560"><span class="lineNum">    4560</span>              : </span>
<span id="L4561"><span class="lineNum">    4561</span>              : #if __cplusplus &lt;= 201103L || _GLIBCXX_USE_DEPRECATED</span>
<span id="L4562"><span class="lineNum">    4562</span>              : #if _GLIBCXX_HOSTED</span>
<span id="L4563"><span class="lineNum">    4563</span>              :   /**</span>
<span id="L4564"><span class="lineNum">    4564</span>              :    *  @brief Randomly shuffle the elements of a sequence.</span>
<span id="L4565"><span class="lineNum">    4565</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4566"><span class="lineNum">    4566</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L4567"><span class="lineNum">    4567</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L4568"><span class="lineNum">    4568</span>              :    *  @return  Nothing.</span>
<span id="L4569"><span class="lineNum">    4569</span>              :    *</span>
<span id="L4570"><span class="lineNum">    4570</span>              :    *  Reorder the elements in the range `[__first, __last)` using a random</span>
<span id="L4571"><span class="lineNum">    4571</span>              :    *  distribution, so that every possible ordering of the sequence is</span>
<span id="L4572"><span class="lineNum">    4572</span>              :    *  equally likely.</span>
<span id="L4573"><span class="lineNum">    4573</span>              :    *</span>
<span id="L4574"><span class="lineNum">    4574</span>              :    *  @deprecated</span>
<span id="L4575"><span class="lineNum">    4575</span>              :    *  Since C++17, `std::random_shuffle` is not part of the C++ standard.</span>
<span id="L4576"><span class="lineNum">    4576</span>              :    *  Use `std::shuffle` instead, which was introduced in C++11.</span>
<span id="L4577"><span class="lineNum">    4577</span>              :   */</span>
<span id="L4578"><span class="lineNum">    4578</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L4579"><span class="lineNum">    4579</span>              :     _GLIBCXX14_DEPRECATED_SUGGEST(&quot;std::shuffle&quot;)</span>
<span id="L4580"><span class="lineNum">    4580</span>              :     inline void</span>
<span id="L4581"><span class="lineNum">    4581</span>              :     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)</span>
<span id="L4582"><span class="lineNum">    4582</span>              :     {</span>
<span id="L4583"><span class="lineNum">    4583</span>              :       // concept requirements</span>
<span id="L4584"><span class="lineNum">    4584</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4585"><span class="lineNum">    4585</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4586"><span class="lineNum">    4586</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4587"><span class="lineNum">    4587</span>              : </span>
<span id="L4588"><span class="lineNum">    4588</span>              :       if (__first != __last)</span>
<span id="L4589"><span class="lineNum">    4589</span>              :         for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)</span>
<span id="L4590"><span class="lineNum">    4590</span>              :           {</span>
<span id="L4591"><span class="lineNum">    4591</span>              :             // XXX rand() % N is not uniformly distributed</span>
<span id="L4592"><span class="lineNum">    4592</span>              :             _RandomAccessIterator __j = __first</span>
<span id="L4593"><span class="lineNum">    4593</span>              :                                         + std::rand() % ((__i - __first) + 1);</span>
<span id="L4594"><span class="lineNum">    4594</span>              :             if (__i != __j)</span>
<span id="L4595"><span class="lineNum">    4595</span>              :               std::iter_swap(__i, __j);</span>
<span id="L4596"><span class="lineNum">    4596</span>              :           }</span>
<span id="L4597"><span class="lineNum">    4597</span>              :     }</span>
<span id="L4598"><span class="lineNum">    4598</span>              : </span>
<span id="L4599"><span class="lineNum">    4599</span>              :   /**</span>
<span id="L4600"><span class="lineNum">    4600</span>              :    *  @brief Shuffle the elements of a sequence using a random number</span>
<span id="L4601"><span class="lineNum">    4601</span>              :    *         generator.</span>
<span id="L4602"><span class="lineNum">    4602</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4603"><span class="lineNum">    4603</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L4604"><span class="lineNum">    4604</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L4605"><span class="lineNum">    4605</span>              :    *  @param  __rand    The RNG functor or function.</span>
<span id="L4606"><span class="lineNum">    4606</span>              :    *  @return  Nothing.</span>
<span id="L4607"><span class="lineNum">    4607</span>              :    *</span>
<span id="L4608"><span class="lineNum">    4608</span>              :    *  Reorders the elements in the range `[__first, __last)` using `__rand`</span>
<span id="L4609"><span class="lineNum">    4609</span>              :    *  to provide a random distribution. Calling `__rand(N)` for a positive</span>
<span id="L4610"><span class="lineNum">    4610</span>              :    *  integer `N` should return a randomly chosen integer from the</span>
<span id="L4611"><span class="lineNum">    4611</span>              :    *  range `[0, N)`.</span>
<span id="L4612"><span class="lineNum">    4612</span>              :    *</span>
<span id="L4613"><span class="lineNum">    4613</span>              :    *  @deprecated</span>
<span id="L4614"><span class="lineNum">    4614</span>              :    *  Since C++17, `std::random_shuffle` is not part of the C++ standard.</span>
<span id="L4615"><span class="lineNum">    4615</span>              :    *  Use `std::shuffle` instead, which was introduced in C++11.</span>
<span id="L4616"><span class="lineNum">    4616</span>              :   */</span>
<span id="L4617"><span class="lineNum">    4617</span>              :   template&lt;typename _RandomAccessIterator, typename _RandomNumberGenerator&gt;</span>
<span id="L4618"><span class="lineNum">    4618</span>              :     _GLIBCXX14_DEPRECATED_SUGGEST(&quot;std::shuffle&quot;)</span>
<span id="L4619"><span class="lineNum">    4619</span>              :     void</span>
<span id="L4620"><span class="lineNum">    4620</span>              :     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L4621"><span class="lineNum">    4621</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L4622"><span class="lineNum">    4622</span>              :                    _RandomNumberGenerator&amp;&amp; __rand)</span>
<span id="L4623"><span class="lineNum">    4623</span>              : #else</span>
<span id="L4624"><span class="lineNum">    4624</span>              :                    _RandomNumberGenerator&amp; __rand)</span>
<span id="L4625"><span class="lineNum">    4625</span>              : #endif</span>
<span id="L4626"><span class="lineNum">    4626</span>              :     {</span>
<span id="L4627"><span class="lineNum">    4627</span>              :       // concept requirements</span>
<span id="L4628"><span class="lineNum">    4628</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4629"><span class="lineNum">    4629</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4630"><span class="lineNum">    4630</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4631"><span class="lineNum">    4631</span>              : </span>
<span id="L4632"><span class="lineNum">    4632</span>              :       if (__first == __last)</span>
<span id="L4633"><span class="lineNum">    4633</span>              :         return;</span>
<span id="L4634"><span class="lineNum">    4634</span>              :       for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)</span>
<span id="L4635"><span class="lineNum">    4635</span>              :         {</span>
<span id="L4636"><span class="lineNum">    4636</span>              :           _RandomAccessIterator __j = __first + __rand((__i - __first) + 1);</span>
<span id="L4637"><span class="lineNum">    4637</span>              :           if (__i != __j)</span>
<span id="L4638"><span class="lineNum">    4638</span>              :             std::iter_swap(__i, __j);</span>
<span id="L4639"><span class="lineNum">    4639</span>              :         }</span>
<span id="L4640"><span class="lineNum">    4640</span>              :     }</span>
<span id="L4641"><span class="lineNum">    4641</span>              : #endif // HOSTED</span>
<span id="L4642"><span class="lineNum">    4642</span>              : #endif // &lt;= C++11 || USE_DEPRECATED</span>
<span id="L4643"><span class="lineNum">    4643</span>              : </span>
<span id="L4644"><span class="lineNum">    4644</span>              :   /**</span>
<span id="L4645"><span class="lineNum">    4645</span>              :    *  @brief Move elements for which a predicate is true to the beginning</span>
<span id="L4646"><span class="lineNum">    4646</span>              :    *         of a sequence.</span>
<span id="L4647"><span class="lineNum">    4647</span>              :    *  @ingroup mutating_algorithms</span>
<span id="L4648"><span class="lineNum">    4648</span>              :    *  @param  __first   A forward iterator.</span>
<span id="L4649"><span class="lineNum">    4649</span>              :    *  @param  __last    A forward iterator.</span>
<span id="L4650"><span class="lineNum">    4650</span>              :    *  @param  __pred    A predicate functor.</span>
<span id="L4651"><span class="lineNum">    4651</span>              :    *  @return  An iterator `middle` such that `__pred(i)` is true for each</span>
<span id="L4652"><span class="lineNum">    4652</span>              :    *  iterator `i` in the range `[__first, middle)` and false for each `i`</span>
<span id="L4653"><span class="lineNum">    4653</span>              :    *  in the range `[middle, __last)`.</span>
<span id="L4654"><span class="lineNum">    4654</span>              :    *</span>
<span id="L4655"><span class="lineNum">    4655</span>              :    *  `__pred` must not modify its operand. `partition()` does not preserve</span>
<span id="L4656"><span class="lineNum">    4656</span>              :    *  the relative ordering of elements in each group, use</span>
<span id="L4657"><span class="lineNum">    4657</span>              :    *  `stable_partition()` if this is needed.</span>
<span id="L4658"><span class="lineNum">    4658</span>              :   */</span>
<span id="L4659"><span class="lineNum">    4659</span>              :   template&lt;typename _ForwardIterator, typename _Predicate&gt;</span>
<span id="L4660"><span class="lineNum">    4660</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4661"><span class="lineNum">    4661</span>              :     inline _ForwardIterator</span>
<span id="L4662"><span class="lineNum">    4662</span>              :     partition(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L4663"><span class="lineNum">    4663</span>              :               _Predicate   __pred)</span>
<span id="L4664"><span class="lineNum">    4664</span>              :     {</span>
<span id="L4665"><span class="lineNum">    4665</span>              :       // concept requirements</span>
<span id="L4666"><span class="lineNum">    4666</span>              :       __glibcxx_function_requires(_Mutable_ForwardIteratorConcept&lt;</span>
<span id="L4667"><span class="lineNum">    4667</span>              :                                   _ForwardIterator&gt;)</span>
<span id="L4668"><span class="lineNum">    4668</span>              :       __glibcxx_function_requires(_UnaryPredicateConcept&lt;_Predicate,</span>
<span id="L4669"><span class="lineNum">    4669</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L4670"><span class="lineNum">    4670</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4671"><span class="lineNum">    4671</span>              : </span>
<span id="L4672"><span class="lineNum">    4672</span>              :       return std::__partition(__first, __last, __pred,</span>
<span id="L4673"><span class="lineNum">    4673</span>              :                               std::__iterator_category(__first));</span>
<span id="L4674"><span class="lineNum">    4674</span>              :     }</span>
<span id="L4675"><span class="lineNum">    4675</span>              : </span>
<span id="L4676"><span class="lineNum">    4676</span>              : </span>
<span id="L4677"><span class="lineNum">    4677</span>              :   /**</span>
<span id="L4678"><span class="lineNum">    4678</span>              :    *  @brief Sort the smallest elements of a sequence.</span>
<span id="L4679"><span class="lineNum">    4679</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4680"><span class="lineNum">    4680</span>              :    *  @param  __first   An iterator.</span>
<span id="L4681"><span class="lineNum">    4681</span>              :    *  @param  __middle  Another iterator.</span>
<span id="L4682"><span class="lineNum">    4682</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4683"><span class="lineNum">    4683</span>              :    *  @return  Nothing.</span>
<span id="L4684"><span class="lineNum">    4684</span>              :    *</span>
<span id="L4685"><span class="lineNum">    4685</span>              :    *  Sorts the smallest `(__middle - __first)` elements in the range</span>
<span id="L4686"><span class="lineNum">    4686</span>              :    *  `[first, last)` and moves them to the range `[__first, __middle)`. The</span>
<span id="L4687"><span class="lineNum">    4687</span>              :    *  order of the remaining elements in the range `[__middle, __last)` is</span>
<span id="L4688"><span class="lineNum">    4688</span>              :    *  unspecified.</span>
<span id="L4689"><span class="lineNum">    4689</span>              :    *  After the sort if `i` and `j` are iterators in the range</span>
<span id="L4690"><span class="lineNum">    4690</span>              :    *  `[__first, __middle)` such that `i` precedes `j` and `k` is an iterator</span>
<span id="L4691"><span class="lineNum">    4691</span>              :    *  in the range `[__middle, __last)` then `*j &lt; *i` and `*k &lt; *i` are</span>
<span id="L4692"><span class="lineNum">    4692</span>              :    *  both false.</span>
<span id="L4693"><span class="lineNum">    4693</span>              :   */</span>
<span id="L4694"><span class="lineNum">    4694</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L4695"><span class="lineNum">    4695</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4696"><span class="lineNum">    4696</span>              :     inline void</span>
<span id="L4697"><span class="lineNum">    4697</span>              :     partial_sort(_RandomAccessIterator __first,</span>
<span id="L4698"><span class="lineNum">    4698</span>              :                  _RandomAccessIterator __middle,</span>
<span id="L4699"><span class="lineNum">    4699</span>              :                  _RandomAccessIterator __last)</span>
<span id="L4700"><span class="lineNum">    4700</span>              :     {</span>
<span id="L4701"><span class="lineNum">    4701</span>              :       // concept requirements</span>
<span id="L4702"><span class="lineNum">    4702</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4703"><span class="lineNum">    4703</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4704"><span class="lineNum">    4704</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L4705"><span class="lineNum">    4705</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4706"><span class="lineNum">    4706</span>              :       __glibcxx_requires_valid_range(__first, __middle);</span>
<span id="L4707"><span class="lineNum">    4707</span>              :       __glibcxx_requires_valid_range(__middle, __last);</span>
<span id="L4708"><span class="lineNum">    4708</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L4709"><span class="lineNum">    4709</span>              : </span>
<span id="L4710"><span class="lineNum">    4710</span>              :       std::__partial_sort(__first, __middle, __last,</span>
<span id="L4711"><span class="lineNum">    4711</span>              :                           __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L4712"><span class="lineNum">    4712</span>              :     }</span>
<span id="L4713"><span class="lineNum">    4713</span>              : </span>
<span id="L4714"><span class="lineNum">    4714</span>              :   /**</span>
<span id="L4715"><span class="lineNum">    4715</span>              :    *  @brief Sort the smallest elements of a sequence using a predicate</span>
<span id="L4716"><span class="lineNum">    4716</span>              :    *         for comparison.</span>
<span id="L4717"><span class="lineNum">    4717</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4718"><span class="lineNum">    4718</span>              :    *  @param  __first   An iterator.</span>
<span id="L4719"><span class="lineNum">    4719</span>              :    *  @param  __middle  Another iterator.</span>
<span id="L4720"><span class="lineNum">    4720</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4721"><span class="lineNum">    4721</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L4722"><span class="lineNum">    4722</span>              :    *  @return  Nothing.</span>
<span id="L4723"><span class="lineNum">    4723</span>              :    *</span>
<span id="L4724"><span class="lineNum">    4724</span>              :    *  Sorts the smallest `(__middle - __first)` elements in the range</span>
<span id="L4725"><span class="lineNum">    4725</span>              :    *  `[__first, __last)` and moves them to the range `[__first, __middle)`.</span>
<span id="L4726"><span class="lineNum">    4726</span>              :    *  The order of the remaining elements in the range `[__middle, __last)` is</span>
<span id="L4727"><span class="lineNum">    4727</span>              :    *  unspecified.</span>
<span id="L4728"><span class="lineNum">    4728</span>              :    *  After the sort if `i` and `j` are iterators in the range</span>
<span id="L4729"><span class="lineNum">    4729</span>              :    *  `[__first, __middle)` such that `i` precedes `j` and `k` is an iterator</span>
<span id="L4730"><span class="lineNum">    4730</span>              :    *  in the range `[__middle, __last)` then `*__comp(j, *i)` and</span>
<span id="L4731"><span class="lineNum">    4731</span>              :    *  `__comp(*k, *i)` are both false.</span>
<span id="L4732"><span class="lineNum">    4732</span>              :   */</span>
<span id="L4733"><span class="lineNum">    4733</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L4734"><span class="lineNum">    4734</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4735"><span class="lineNum">    4735</span>              :     inline void</span>
<span id="L4736"><span class="lineNum">    4736</span>              :     partial_sort(_RandomAccessIterator __first,</span>
<span id="L4737"><span class="lineNum">    4737</span>              :                  _RandomAccessIterator __middle,</span>
<span id="L4738"><span class="lineNum">    4738</span>              :                  _RandomAccessIterator __last,</span>
<span id="L4739"><span class="lineNum">    4739</span>              :                  _Compare __comp)</span>
<span id="L4740"><span class="lineNum">    4740</span>              :     {</span>
<span id="L4741"><span class="lineNum">    4741</span>              :       // concept requirements</span>
<span id="L4742"><span class="lineNum">    4742</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4743"><span class="lineNum">    4743</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4744"><span class="lineNum">    4744</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L4745"><span class="lineNum">    4745</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type,</span>
<span id="L4746"><span class="lineNum">    4746</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4747"><span class="lineNum">    4747</span>              :       __glibcxx_requires_valid_range(__first, __middle);</span>
<span id="L4748"><span class="lineNum">    4748</span>              :       __glibcxx_requires_valid_range(__middle, __last);</span>
<span id="L4749"><span class="lineNum">    4749</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L4750"><span class="lineNum">    4750</span>              : </span>
<span id="L4751"><span class="lineNum">    4751</span>              :       std::__partial_sort(__first, __middle, __last,</span>
<span id="L4752"><span class="lineNum">    4752</span>              :                           __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L4753"><span class="lineNum">    4753</span>              :     }</span>
<span id="L4754"><span class="lineNum">    4754</span>              : </span>
<span id="L4755"><span class="lineNum">    4755</span>              :   /**</span>
<span id="L4756"><span class="lineNum">    4756</span>              :    *  @brief Sort a sequence just enough to find a particular position.</span>
<span id="L4757"><span class="lineNum">    4757</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4758"><span class="lineNum">    4758</span>              :    *  @param  __first   An iterator.</span>
<span id="L4759"><span class="lineNum">    4759</span>              :    *  @param  __nth     Another iterator.</span>
<span id="L4760"><span class="lineNum">    4760</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4761"><span class="lineNum">    4761</span>              :    *  @return  Nothing.</span>
<span id="L4762"><span class="lineNum">    4762</span>              :    *</span>
<span id="L4763"><span class="lineNum">    4763</span>              :    *  Rearranges the elements in the range `[__first, __last)` so that `*__nth`</span>
<span id="L4764"><span class="lineNum">    4764</span>              :    *  is the same element that would have been in that position had the</span>
<span id="L4765"><span class="lineNum">    4765</span>              :    *  whole sequence been sorted. The elements either side of `*__nth` are</span>
<span id="L4766"><span class="lineNum">    4766</span>              :    *  not completely sorted, but for any iterator `i` in the range</span>
<span id="L4767"><span class="lineNum">    4767</span>              :    *  `[__first, __nth)` and any iterator `j` in the range `[__nth, __last)` it</span>
<span id="L4768"><span class="lineNum">    4768</span>              :    *  holds that `*j &lt; *i` is false.</span>
<span id="L4769"><span class="lineNum">    4769</span>              :   */</span>
<span id="L4770"><span class="lineNum">    4770</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L4771"><span class="lineNum">    4771</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4772"><span class="lineNum">    4772</span>              :     inline void</span>
<span id="L4773"><span class="lineNum">    4773</span>              :     nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,</span>
<span id="L4774"><span class="lineNum">    4774</span>              :                 _RandomAccessIterator __last)</span>
<span id="L4775"><span class="lineNum">    4775</span>              :     {</span>
<span id="L4776"><span class="lineNum">    4776</span>              :       // concept requirements</span>
<span id="L4777"><span class="lineNum">    4777</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4778"><span class="lineNum">    4778</span>              :                                   _RandomAccessIterator&gt;)</span>
<span id="L4779"><span class="lineNum">    4779</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L4780"><span class="lineNum">    4780</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4781"><span class="lineNum">    4781</span>              :       __glibcxx_requires_valid_range(__first, __nth);</span>
<span id="L4782"><span class="lineNum">    4782</span>              :       __glibcxx_requires_valid_range(__nth, __last);</span>
<span id="L4783"><span class="lineNum">    4783</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L4784"><span class="lineNum">    4784</span>              : </span>
<span id="L4785"><span class="lineNum">    4785</span>              :       if (__first == __last || __nth == __last)</span>
<span id="L4786"><span class="lineNum">    4786</span>              :         return;</span>
<span id="L4787"><span class="lineNum">    4787</span>              : </span>
<span id="L4788"><span class="lineNum">    4788</span>              :       std::__introselect(__first, __nth, __last,</span>
<span id="L4789"><span class="lineNum">    4789</span>              :                          std::__lg(__last - __first) * 2,</span>
<span id="L4790"><span class="lineNum">    4790</span>              :                          __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L4791"><span class="lineNum">    4791</span>              :     }</span>
<span id="L4792"><span class="lineNum">    4792</span>              : </span>
<span id="L4793"><span class="lineNum">    4793</span>              :   /**</span>
<span id="L4794"><span class="lineNum">    4794</span>              :    *  @brief Sort a sequence just enough to find a particular position</span>
<span id="L4795"><span class="lineNum">    4795</span>              :    *         using a predicate for comparison.</span>
<span id="L4796"><span class="lineNum">    4796</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4797"><span class="lineNum">    4797</span>              :    *  @param  __first   An iterator.</span>
<span id="L4798"><span class="lineNum">    4798</span>              :    *  @param  __nth     Another iterator.</span>
<span id="L4799"><span class="lineNum">    4799</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4800"><span class="lineNum">    4800</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L4801"><span class="lineNum">    4801</span>              :    *  @return  Nothing.</span>
<span id="L4802"><span class="lineNum">    4802</span>              :    *</span>
<span id="L4803"><span class="lineNum">    4803</span>              :    *  Rearranges the elements in the range `[__first, __last)` so that `*__nth`</span>
<span id="L4804"><span class="lineNum">    4804</span>              :    *  is the same element that would have been in that position had the</span>
<span id="L4805"><span class="lineNum">    4805</span>              :    *  whole sequence been sorted. The elements either side of `*__nth` are</span>
<span id="L4806"><span class="lineNum">    4806</span>              :    *  not completely sorted, but for any iterator `i` in the range</span>
<span id="L4807"><span class="lineNum">    4807</span>              :    *  `[__first, __nth)` and any iterator `j` in the range `[__nth, __last)`</span>
<span id="L4808"><span class="lineNum">    4808</span>              :    *  it holds that `__comp(*j, *i)` is false.</span>
<span id="L4809"><span class="lineNum">    4809</span>              :   */</span>
<span id="L4810"><span class="lineNum">    4810</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L4811"><span class="lineNum">    4811</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4812"><span class="lineNum">    4812</span>              :     inline void</span>
<span id="L4813"><span class="lineNum">    4813</span>              :     nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,</span>
<span id="L4814"><span class="lineNum">    4814</span>              :                 _RandomAccessIterator __last, _Compare __comp)</span>
<span id="L4815"><span class="lineNum">    4815</span>              :     {</span>
<span id="L4816"><span class="lineNum">    4816</span>              :       // concept requirements</span>
<span id="L4817"><span class="lineNum">    4817</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4818"><span class="lineNum">    4818</span>              :                                   _RandomAccessIterator&gt;)</span>
<span id="L4819"><span class="lineNum">    4819</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L4820"><span class="lineNum">    4820</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type,</span>
<span id="L4821"><span class="lineNum">    4821</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4822"><span class="lineNum">    4822</span>              :       __glibcxx_requires_valid_range(__first, __nth);</span>
<span id="L4823"><span class="lineNum">    4823</span>              :       __glibcxx_requires_valid_range(__nth, __last);</span>
<span id="L4824"><span class="lineNum">    4824</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L4825"><span class="lineNum">    4825</span>              : </span>
<span id="L4826"><span class="lineNum">    4826</span>              :       if (__first == __last || __nth == __last)</span>
<span id="L4827"><span class="lineNum">    4827</span>              :         return;</span>
<span id="L4828"><span class="lineNum">    4828</span>              : </span>
<span id="L4829"><span class="lineNum">    4829</span>              :       std::__introselect(__first, __nth, __last,</span>
<span id="L4830"><span class="lineNum">    4830</span>              :                          std::__lg(__last - __first) * 2,</span>
<span id="L4831"><span class="lineNum">    4831</span>              :                          __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L4832"><span class="lineNum">    4832</span>              :     }</span>
<span id="L4833"><span class="lineNum">    4833</span>              : </span>
<span id="L4834"><span class="lineNum">    4834</span>              :   /**</span>
<span id="L4835"><span class="lineNum">    4835</span>              :    *  @brief Sort the elements of a sequence.</span>
<span id="L4836"><span class="lineNum">    4836</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4837"><span class="lineNum">    4837</span>              :    *  @param  __first   An iterator.</span>
<span id="L4838"><span class="lineNum">    4838</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4839"><span class="lineNum">    4839</span>              :    *  @return  Nothing.</span>
<span id="L4840"><span class="lineNum">    4840</span>              :    *</span>
<span id="L4841"><span class="lineNum">    4841</span>              :    *  Sorts the elements in the range `[__first, __last)` in ascending order,</span>
<span id="L4842"><span class="lineNum">    4842</span>              :    *  such that for each iterator `i` in the range `[__first, __last - 1)`,</span>
<span id="L4843"><span class="lineNum">    4843</span>              :    *  `*(i+1) &lt; *i` is false.</span>
<span id="L4844"><span class="lineNum">    4844</span>              :    *</span>
<span id="L4845"><span class="lineNum">    4845</span>              :    *  The relative ordering of equivalent elements is not preserved, use</span>
<span id="L4846"><span class="lineNum">    4846</span>              :    *  `stable_sort()` if this is needed.</span>
<span id="L4847"><span class="lineNum">    4847</span>              :   */</span>
<span id="L4848"><span class="lineNum">    4848</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L4849"><span class="lineNum">    4849</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4850"><span class="lineNum">    4850</span>              :     inline void</span>
<span id="L4851"><span class="lineNum">    4851</span>              :     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)</span>
<span id="L4852"><span class="lineNum">    4852</span>              :     {</span>
<span id="L4853"><span class="lineNum">    4853</span>              :       // concept requirements</span>
<span id="L4854"><span class="lineNum">    4854</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4855"><span class="lineNum">    4855</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4856"><span class="lineNum">    4856</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L4857"><span class="lineNum">    4857</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4858"><span class="lineNum">    4858</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4859"><span class="lineNum">    4859</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L4860"><span class="lineNum">    4860</span>              : </span>
<span id="L4861"><span class="lineNum">    4861</span>              :       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L4862"><span class="lineNum">    4862</span>              :     }</span>
<span id="L4863"><span class="lineNum">    4863</span>              : </span>
<span id="L4864"><span class="lineNum">    4864</span>              :   /**</span>
<span id="L4865"><span class="lineNum">    4865</span>              :    *  @brief Sort the elements of a sequence using a predicate for comparison.</span>
<span id="L4866"><span class="lineNum">    4866</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4867"><span class="lineNum">    4867</span>              :    *  @param  __first   An iterator.</span>
<span id="L4868"><span class="lineNum">    4868</span>              :    *  @param  __last    Another iterator.</span>
<span id="L4869"><span class="lineNum">    4869</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L4870"><span class="lineNum">    4870</span>              :    *  @return  Nothing.</span>
<span id="L4871"><span class="lineNum">    4871</span>              :    *</span>
<span id="L4872"><span class="lineNum">    4872</span>              :    *  Sorts the elements in the range `[__first, __last)` in ascending order,</span>
<span id="L4873"><span class="lineNum">    4873</span>              :    *  such that `__comp(*(i+1), *i)` is false for every iterator `i` in the</span>
<span id="L4874"><span class="lineNum">    4874</span>              :    *  range `[__first, __last - 1)`.</span>
<span id="L4875"><span class="lineNum">    4875</span>              :    *</span>
<span id="L4876"><span class="lineNum">    4876</span>              :    *  The relative ordering of equivalent elements is not preserved, use</span>
<span id="L4877"><span class="lineNum">    4877</span>              :    *  `stable_sort()` if this is needed.</span>
<span id="L4878"><span class="lineNum">    4878</span>              :   */</span>
<span id="L4879"><span class="lineNum">    4879</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L4880"><span class="lineNum">    4880</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4881"><span class="lineNum">    4881</span>              :     inline void</span>
<span id="L4882"><span class="lineNum">    4882</span>              :     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L4883"><span class="lineNum">    4883</span>              :          _Compare __comp)</span>
<span id="L4884"><span class="lineNum">    4884</span>              :     {</span>
<span id="L4885"><span class="lineNum">    4885</span>              :       // concept requirements</span>
<span id="L4886"><span class="lineNum">    4886</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L4887"><span class="lineNum">    4887</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L4888"><span class="lineNum">    4888</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L4889"><span class="lineNum">    4889</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type,</span>
<span id="L4890"><span class="lineNum">    4890</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L4891"><span class="lineNum">    4891</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L4892"><span class="lineNum">    4892</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L4893"><span class="lineNum">    4893</span>              : </span>
<span id="L4894"><span class="lineNum">    4894</span>              :       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L4895"><span class="lineNum">    4895</span>              :     }</span>
<span id="L4896"><span class="lineNum">    4896</span>              : </span>
<span id="L4897"><span class="lineNum">    4897</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L4898"><span class="lineNum">    4898</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L4899"><span class="lineNum">    4899</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4900"><span class="lineNum">    4900</span>              :     _OutputIterator</span>
<span id="L4901"><span class="lineNum">    4901</span>              :     __merge(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L4902"><span class="lineNum">    4902</span>              :             _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L4903"><span class="lineNum">    4903</span>              :             _OutputIterator __result, _Compare __comp)</span>
<span id="L4904"><span class="lineNum">    4904</span>              :     {</span>
<span id="L4905"><span class="lineNum">    4905</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L4906"><span class="lineNum">    4906</span>              :         {</span>
<span id="L4907"><span class="lineNum">    4907</span>              :           if (__comp(__first2, __first1))</span>
<span id="L4908"><span class="lineNum">    4908</span>              :             {</span>
<span id="L4909"><span class="lineNum">    4909</span>              :               *__result = *__first2;</span>
<span id="L4910"><span class="lineNum">    4910</span>              :               ++__first2;</span>
<span id="L4911"><span class="lineNum">    4911</span>              :             }</span>
<span id="L4912"><span class="lineNum">    4912</span>              :           else</span>
<span id="L4913"><span class="lineNum">    4913</span>              :             {</span>
<span id="L4914"><span class="lineNum">    4914</span>              :               *__result = *__first1;</span>
<span id="L4915"><span class="lineNum">    4915</span>              :               ++__first1;</span>
<span id="L4916"><span class="lineNum">    4916</span>              :             }</span>
<span id="L4917"><span class="lineNum">    4917</span>              :           ++__result;</span>
<span id="L4918"><span class="lineNum">    4918</span>              :         }</span>
<span id="L4919"><span class="lineNum">    4919</span>              :       return std::copy(__first2, __last2,</span>
<span id="L4920"><span class="lineNum">    4920</span>              :                        std::copy(__first1, __last1, __result));</span>
<span id="L4921"><span class="lineNum">    4921</span>              :     }</span>
<span id="L4922"><span class="lineNum">    4922</span>              : </span>
<span id="L4923"><span class="lineNum">    4923</span>              :   /**</span>
<span id="L4924"><span class="lineNum">    4924</span>              :    *  @brief Merges two sorted ranges.</span>
<span id="L4925"><span class="lineNum">    4925</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4926"><span class="lineNum">    4926</span>              :    *  @param  __first1  An iterator.</span>
<span id="L4927"><span class="lineNum">    4927</span>              :    *  @param  __first2  Another iterator.</span>
<span id="L4928"><span class="lineNum">    4928</span>              :    *  @param  __last1   Another iterator.</span>
<span id="L4929"><span class="lineNum">    4929</span>              :    *  @param  __last2   Another iterator.</span>
<span id="L4930"><span class="lineNum">    4930</span>              :    *  @param  __result  An iterator pointing to the end of the merged range.</span>
<span id="L4931"><span class="lineNum">    4931</span>              :    *  @return   An output iterator equal to @p __result + (__last1 - __first1)</span>
<span id="L4932"><span class="lineNum">    4932</span>              :    *            + (__last2 - __first2).</span>
<span id="L4933"><span class="lineNum">    4933</span>              :    *</span>
<span id="L4934"><span class="lineNum">    4934</span>              :    *  Merges the ranges @p [__first1,__last1) and @p [__first2,__last2) into</span>
<span id="L4935"><span class="lineNum">    4935</span>              :    *  the sorted range @p [__result, __result + (__last1-__first1) +</span>
<span id="L4936"><span class="lineNum">    4936</span>              :    *  (__last2-__first2)).  Both input ranges must be sorted, and the</span>
<span id="L4937"><span class="lineNum">    4937</span>              :    *  output range must not overlap with either of the input ranges.</span>
<span id="L4938"><span class="lineNum">    4938</span>              :    *  The sort is @e stable, that is, for equivalent elements in the</span>
<span id="L4939"><span class="lineNum">    4939</span>              :    *  two ranges, elements from the first range will always come</span>
<span id="L4940"><span class="lineNum">    4940</span>              :    *  before elements from the second.</span>
<span id="L4941"><span class="lineNum">    4941</span>              :   */</span>
<span id="L4942"><span class="lineNum">    4942</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L4943"><span class="lineNum">    4943</span>              :            typename _OutputIterator&gt;</span>
<span id="L4944"><span class="lineNum">    4944</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4945"><span class="lineNum">    4945</span>              :     inline _OutputIterator</span>
<span id="L4946"><span class="lineNum">    4946</span>              :     merge(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L4947"><span class="lineNum">    4947</span>              :           _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L4948"><span class="lineNum">    4948</span>              :           _OutputIterator __result)</span>
<span id="L4949"><span class="lineNum">    4949</span>              :     {</span>
<span id="L4950"><span class="lineNum">    4950</span>              :       // concept requirements</span>
<span id="L4951"><span class="lineNum">    4951</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L4952"><span class="lineNum">    4952</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L4953"><span class="lineNum">    4953</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4954"><span class="lineNum">    4954</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L4955"><span class="lineNum">    4955</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L4956"><span class="lineNum">    4956</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L4957"><span class="lineNum">    4957</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L4958"><span class="lineNum">    4958</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L4959"><span class="lineNum">    4959</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)    </span>
<span id="L4960"><span class="lineNum">    4960</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L4961"><span class="lineNum">    4961</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L4962"><span class="lineNum">    4962</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L4963"><span class="lineNum">    4963</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L4964"><span class="lineNum">    4964</span>              : </span>
<span id="L4965"><span class="lineNum">    4965</span>              :       return _GLIBCXX_STD_A::__merge(__first1, __last1,</span>
<span id="L4966"><span class="lineNum">    4966</span>              :                                      __first2, __last2, __result,</span>
<span id="L4967"><span class="lineNum">    4967</span>              :                                      __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L4968"><span class="lineNum">    4968</span>              :     }</span>
<span id="L4969"><span class="lineNum">    4969</span>              : </span>
<span id="L4970"><span class="lineNum">    4970</span>              :   /**</span>
<span id="L4971"><span class="lineNum">    4971</span>              :    *  @brief Merges two sorted ranges.</span>
<span id="L4972"><span class="lineNum">    4972</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L4973"><span class="lineNum">    4973</span>              :    *  @param  __first1  An iterator.</span>
<span id="L4974"><span class="lineNum">    4974</span>              :    *  @param  __first2  Another iterator.</span>
<span id="L4975"><span class="lineNum">    4975</span>              :    *  @param  __last1   Another iterator.</span>
<span id="L4976"><span class="lineNum">    4976</span>              :    *  @param  __last2   Another iterator.</span>
<span id="L4977"><span class="lineNum">    4977</span>              :    *  @param  __result  An iterator pointing to the end of the merged range.</span>
<span id="L4978"><span class="lineNum">    4978</span>              :    *  @param  __comp    A functor to use for comparisons.</span>
<span id="L4979"><span class="lineNum">    4979</span>              :    *  @return   An output iterator equal to @p __result + (__last1 - __first1)</span>
<span id="L4980"><span class="lineNum">    4980</span>              :    *            + (__last2 - __first2).</span>
<span id="L4981"><span class="lineNum">    4981</span>              :    *</span>
<span id="L4982"><span class="lineNum">    4982</span>              :    *  Merges the ranges @p [__first1,__last1) and @p [__first2,__last2) into</span>
<span id="L4983"><span class="lineNum">    4983</span>              :    *  the sorted range @p [__result, __result + (__last1-__first1) +</span>
<span id="L4984"><span class="lineNum">    4984</span>              :    *  (__last2-__first2)).  Both input ranges must be sorted, and the</span>
<span id="L4985"><span class="lineNum">    4985</span>              :    *  output range must not overlap with either of the input ranges.</span>
<span id="L4986"><span class="lineNum">    4986</span>              :    *  The sort is @e stable, that is, for equivalent elements in the</span>
<span id="L4987"><span class="lineNum">    4987</span>              :    *  two ranges, elements from the first range will always come</span>
<span id="L4988"><span class="lineNum">    4988</span>              :    *  before elements from the second.</span>
<span id="L4989"><span class="lineNum">    4989</span>              :    *</span>
<span id="L4990"><span class="lineNum">    4990</span>              :    *  The comparison function should have the same effects on ordering as</span>
<span id="L4991"><span class="lineNum">    4991</span>              :    *  the function used for the initial sort.</span>
<span id="L4992"><span class="lineNum">    4992</span>              :   */</span>
<span id="L4993"><span class="lineNum">    4993</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L4994"><span class="lineNum">    4994</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L4995"><span class="lineNum">    4995</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L4996"><span class="lineNum">    4996</span>              :     inline _OutputIterator</span>
<span id="L4997"><span class="lineNum">    4997</span>              :     merge(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L4998"><span class="lineNum">    4998</span>              :           _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L4999"><span class="lineNum">    4999</span>              :           _OutputIterator __result, _Compare __comp)</span>
<span id="L5000"><span class="lineNum">    5000</span>              :     {</span>
<span id="L5001"><span class="lineNum">    5001</span>              :       // concept requirements</span>
<span id="L5002"><span class="lineNum">    5002</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5003"><span class="lineNum">    5003</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5004"><span class="lineNum">    5004</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5005"><span class="lineNum">    5005</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5006"><span class="lineNum">    5006</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5007"><span class="lineNum">    5007</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5008"><span class="lineNum">    5008</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5009"><span class="lineNum">    5009</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5010"><span class="lineNum">    5010</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5011"><span class="lineNum">    5011</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L5012"><span class="lineNum">    5012</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L5013"><span class="lineNum">    5013</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L5014"><span class="lineNum">    5014</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L5015"><span class="lineNum">    5015</span>              : </span>
<span id="L5016"><span class="lineNum">    5016</span>              :       return _GLIBCXX_STD_A::__merge(__first1, __last1,</span>
<span id="L5017"><span class="lineNum">    5017</span>              :                                 __first2, __last2, __result,</span>
<span id="L5018"><span class="lineNum">    5018</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5019"><span class="lineNum">    5019</span>              :     }</span>
<span id="L5020"><span class="lineNum">    5020</span>              : </span>
<span id="L5021"><span class="lineNum">    5021</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L5022"><span class="lineNum">    5022</span>              :     inline void</span>
<span id="L5023"><span class="lineNum">    5023</span>              :     __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L5024"><span class="lineNum">    5024</span>              :                   _Compare __comp)</span>
<span id="L5025"><span class="lineNum">    5025</span>              :     {</span>
<span id="L5026"><span class="lineNum">    5026</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type</span>
<span id="L5027"><span class="lineNum">    5027</span>              :         _ValueType;</span>
<span id="L5028"><span class="lineNum">    5028</span>              :       typedef typename iterator_traits&lt;_RandomAccessIterator&gt;::difference_type</span>
<span id="L5029"><span class="lineNum">    5029</span>              :         _DistanceType;</span>
<span id="L5030"><span class="lineNum">    5030</span>              : </span>
<span id="L5031"><span class="lineNum">    5031</span>              :       if (__first == __last)</span>
<span id="L5032"><span class="lineNum">    5032</span>              :         return;</span>
<span id="L5033"><span class="lineNum">    5033</span>              : </span>
<span id="L5034"><span class="lineNum">    5034</span>              : #if _GLIBCXX_HOSTED</span>
<span id="L5035"><span class="lineNum">    5035</span>              :       typedef _Temporary_buffer&lt;_RandomAccessIterator, _ValueType&gt; _TmpBuf;</span>
<span id="L5036"><span class="lineNum">    5036</span>              :       // __stable_sort_adaptive sorts the range in two halves,</span>
<span id="L5037"><span class="lineNum">    5037</span>              :       // so the buffer only needs to fit half the range at once.</span>
<span id="L5038"><span class="lineNum">    5038</span>              :       _TmpBuf __buf(__first, (__last - __first + 1) / 2);</span>
<span id="L5039"><span class="lineNum">    5039</span>              : </span>
<span id="L5040"><span class="lineNum">    5040</span>              :       if (__builtin_expect(__buf.requested_size() == __buf.size(), true))</span>
<span id="L5041"><span class="lineNum">    5041</span>              :         std::__stable_sort_adaptive(__first,</span>
<span id="L5042"><span class="lineNum">    5042</span>              :                                     __first + _DistanceType(__buf.size()),</span>
<span id="L5043"><span class="lineNum">    5043</span>              :                                     __last, __buf.begin(), __comp);</span>
<span id="L5044"><span class="lineNum">    5044</span>              :       else if (__builtin_expect(__buf.begin() == 0, false))</span>
<span id="L5045"><span class="lineNum">    5045</span>              :         std::__inplace_stable_sort(__first, __last, __comp);</span>
<span id="L5046"><span class="lineNum">    5046</span>              :       else</span>
<span id="L5047"><span class="lineNum">    5047</span>              :         std::__stable_sort_adaptive_resize(__first, __last, __buf.begin(),</span>
<span id="L5048"><span class="lineNum">    5048</span>              :                                            _DistanceType(__buf.size()), __comp);</span>
<span id="L5049"><span class="lineNum">    5049</span>              : #else</span>
<span id="L5050"><span class="lineNum">    5050</span>              :       std::__inplace_stable_sort(__first, __last, __comp);</span>
<span id="L5051"><span class="lineNum">    5051</span>              : #endif</span>
<span id="L5052"><span class="lineNum">    5052</span>              :     }</span>
<span id="L5053"><span class="lineNum">    5053</span>              : </span>
<span id="L5054"><span class="lineNum">    5054</span>              :   /**</span>
<span id="L5055"><span class="lineNum">    5055</span>              :    *  @brief Sort the elements of a sequence, preserving the relative order</span>
<span id="L5056"><span class="lineNum">    5056</span>              :    *         of equivalent elements.</span>
<span id="L5057"><span class="lineNum">    5057</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5058"><span class="lineNum">    5058</span>              :    *  @param  __first   An iterator.</span>
<span id="L5059"><span class="lineNum">    5059</span>              :    *  @param  __last    Another iterator.</span>
<span id="L5060"><span class="lineNum">    5060</span>              :    *  @return  Nothing.</span>
<span id="L5061"><span class="lineNum">    5061</span>              :    *</span>
<span id="L5062"><span class="lineNum">    5062</span>              :    *  Sorts the elements in the range @p [__first,__last) in ascending order,</span>
<span id="L5063"><span class="lineNum">    5063</span>              :    *  such that for each iterator @p i in the range @p [__first,__last-1),</span>
<span id="L5064"><span class="lineNum">    5064</span>              :    *  @p *(i+1)&lt;*i is false.</span>
<span id="L5065"><span class="lineNum">    5065</span>              :    *</span>
<span id="L5066"><span class="lineNum">    5066</span>              :    *  The relative ordering of equivalent elements is preserved, so any two</span>
<span id="L5067"><span class="lineNum">    5067</span>              :    *  elements @p x and @p y in the range @p [__first,__last) such that</span>
<span id="L5068"><span class="lineNum">    5068</span>              :    *  @p x&lt;y is false and @p y&lt;x is false will have the same relative</span>
<span id="L5069"><span class="lineNum">    5069</span>              :    *  ordering after calling @p stable_sort().</span>
<span id="L5070"><span class="lineNum">    5070</span>              :   */</span>
<span id="L5071"><span class="lineNum">    5071</span>              :   template&lt;typename _RandomAccessIterator&gt;</span>
<span id="L5072"><span class="lineNum">    5072</span>              :     inline void</span>
<span id="L5073"><span class="lineNum">    5073</span>              :     stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)</span>
<span id="L5074"><span class="lineNum">    5074</span>              :     {</span>
<span id="L5075"><span class="lineNum">    5075</span>              :       // concept requirements</span>
<span id="L5076"><span class="lineNum">    5076</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L5077"><span class="lineNum">    5077</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L5078"><span class="lineNum">    5078</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L5079"><span class="lineNum">    5079</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L5080"><span class="lineNum">    5080</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5081"><span class="lineNum">    5081</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L5082"><span class="lineNum">    5082</span>              : </span>
<span id="L5083"><span class="lineNum">    5083</span>              :       _GLIBCXX_STD_A::__stable_sort(__first, __last,</span>
<span id="L5084"><span class="lineNum">    5084</span>              :                                     __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5085"><span class="lineNum">    5085</span>              :     }</span>
<span id="L5086"><span class="lineNum">    5086</span>              : </span>
<span id="L5087"><span class="lineNum">    5087</span>              :   /**</span>
<span id="L5088"><span class="lineNum">    5088</span>              :    *  @brief Sort the elements of a sequence using a predicate for comparison,</span>
<span id="L5089"><span class="lineNum">    5089</span>              :    *         preserving the relative order of equivalent elements.</span>
<span id="L5090"><span class="lineNum">    5090</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5091"><span class="lineNum">    5091</span>              :    *  @param  __first   An iterator.</span>
<span id="L5092"><span class="lineNum">    5092</span>              :    *  @param  __last    Another iterator.</span>
<span id="L5093"><span class="lineNum">    5093</span>              :    *  @param  __comp    A comparison functor.</span>
<span id="L5094"><span class="lineNum">    5094</span>              :    *  @return  Nothing.</span>
<span id="L5095"><span class="lineNum">    5095</span>              :    *</span>
<span id="L5096"><span class="lineNum">    5096</span>              :    *  Sorts the elements in the range @p [__first,__last) in ascending order,</span>
<span id="L5097"><span class="lineNum">    5097</span>              :    *  such that for each iterator @p i in the range @p [__first,__last-1),</span>
<span id="L5098"><span class="lineNum">    5098</span>              :    *  @p __comp(*(i+1),*i) is false.</span>
<span id="L5099"><span class="lineNum">    5099</span>              :    *</span>
<span id="L5100"><span class="lineNum">    5100</span>              :    *  The relative ordering of equivalent elements is preserved, so any two</span>
<span id="L5101"><span class="lineNum">    5101</span>              :    *  elements @p x and @p y in the range @p [__first,__last) such that</span>
<span id="L5102"><span class="lineNum">    5102</span>              :    *  @p __comp(x,y) is false and @p __comp(y,x) is false will have the same</span>
<span id="L5103"><span class="lineNum">    5103</span>              :    *  relative ordering after calling @p stable_sort().</span>
<span id="L5104"><span class="lineNum">    5104</span>              :   */</span>
<span id="L5105"><span class="lineNum">    5105</span>              :   template&lt;typename _RandomAccessIterator, typename _Compare&gt;</span>
<span id="L5106"><span class="lineNum">    5106</span>              :     inline void</span>
<span id="L5107"><span class="lineNum">    5107</span>              :     stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,</span>
<span id="L5108"><span class="lineNum">    5108</span>              :                 _Compare __comp)</span>
<span id="L5109"><span class="lineNum">    5109</span>              :     {</span>
<span id="L5110"><span class="lineNum">    5110</span>              :       // concept requirements</span>
<span id="L5111"><span class="lineNum">    5111</span>              :       __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept&lt;</span>
<span id="L5112"><span class="lineNum">    5112</span>              :             _RandomAccessIterator&gt;)</span>
<span id="L5113"><span class="lineNum">    5113</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5114"><span class="lineNum">    5114</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type,</span>
<span id="L5115"><span class="lineNum">    5115</span>              :             typename iterator_traits&lt;_RandomAccessIterator&gt;::value_type&gt;)</span>
<span id="L5116"><span class="lineNum">    5116</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5117"><span class="lineNum">    5117</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L5118"><span class="lineNum">    5118</span>              : </span>
<span id="L5119"><span class="lineNum">    5119</span>              :       _GLIBCXX_STD_A::__stable_sort(__first, __last,</span>
<span id="L5120"><span class="lineNum">    5120</span>              :                                     __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5121"><span class="lineNum">    5121</span>              :     }</span>
<span id="L5122"><span class="lineNum">    5122</span>              : </span>
<span id="L5123"><span class="lineNum">    5123</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5124"><span class="lineNum">    5124</span>              :            typename _OutputIterator,</span>
<span id="L5125"><span class="lineNum">    5125</span>              :            typename _Compare&gt;</span>
<span id="L5126"><span class="lineNum">    5126</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5127"><span class="lineNum">    5127</span>              :     _OutputIterator</span>
<span id="L5128"><span class="lineNum">    5128</span>              :     __set_union(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5129"><span class="lineNum">    5129</span>              :                 _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5130"><span class="lineNum">    5130</span>              :                 _OutputIterator __result, _Compare __comp)</span>
<span id="L5131"><span class="lineNum">    5131</span>              :     {</span>
<span id="L5132"><span class="lineNum">    5132</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L5133"><span class="lineNum">    5133</span>              :         {</span>
<span id="L5134"><span class="lineNum">    5134</span>              :           if (__comp(__first1, __first2))</span>
<span id="L5135"><span class="lineNum">    5135</span>              :             {</span>
<span id="L5136"><span class="lineNum">    5136</span>              :               *__result = *__first1;</span>
<span id="L5137"><span class="lineNum">    5137</span>              :               ++__first1;</span>
<span id="L5138"><span class="lineNum">    5138</span>              :             }</span>
<span id="L5139"><span class="lineNum">    5139</span>              :           else if (__comp(__first2, __first1))</span>
<span id="L5140"><span class="lineNum">    5140</span>              :             {</span>
<span id="L5141"><span class="lineNum">    5141</span>              :               *__result = *__first2;</span>
<span id="L5142"><span class="lineNum">    5142</span>              :               ++__first2;</span>
<span id="L5143"><span class="lineNum">    5143</span>              :             }</span>
<span id="L5144"><span class="lineNum">    5144</span>              :           else</span>
<span id="L5145"><span class="lineNum">    5145</span>              :             {</span>
<span id="L5146"><span class="lineNum">    5146</span>              :               *__result = *__first1;</span>
<span id="L5147"><span class="lineNum">    5147</span>              :               ++__first1;</span>
<span id="L5148"><span class="lineNum">    5148</span>              :               ++__first2;</span>
<span id="L5149"><span class="lineNum">    5149</span>              :             }</span>
<span id="L5150"><span class="lineNum">    5150</span>              :           ++__result;</span>
<span id="L5151"><span class="lineNum">    5151</span>              :         }</span>
<span id="L5152"><span class="lineNum">    5152</span>              :       return std::copy(__first2, __last2,</span>
<span id="L5153"><span class="lineNum">    5153</span>              :                        std::copy(__first1, __last1, __result));</span>
<span id="L5154"><span class="lineNum">    5154</span>              :     }</span>
<span id="L5155"><span class="lineNum">    5155</span>              : </span>
<span id="L5156"><span class="lineNum">    5156</span>              :   /**</span>
<span id="L5157"><span class="lineNum">    5157</span>              :    *  @brief Return the union of two sorted ranges.</span>
<span id="L5158"><span class="lineNum">    5158</span>              :    *  @ingroup set_algorithms</span>
<span id="L5159"><span class="lineNum">    5159</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5160"><span class="lineNum">    5160</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5161"><span class="lineNum">    5161</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5162"><span class="lineNum">    5162</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5163"><span class="lineNum">    5163</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5164"><span class="lineNum">    5164</span>              :    *  @return  End of the output range.</span>
<span id="L5165"><span class="lineNum">    5165</span>              :    *  @ingroup set_algorithms</span>
<span id="L5166"><span class="lineNum">    5166</span>              :    *</span>
<span id="L5167"><span class="lineNum">    5167</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5168"><span class="lineNum">    5168</span>              :    *  each range in order to the output range.  Iterators increment for each</span>
<span id="L5169"><span class="lineNum">    5169</span>              :    *  range.  When the current element of one range is less than the other,</span>
<span id="L5170"><span class="lineNum">    5170</span>              :    *  that element is copied and the iterator advanced.  If an element is</span>
<span id="L5171"><span class="lineNum">    5171</span>              :    *  contained in both ranges, the element from the first range is copied and</span>
<span id="L5172"><span class="lineNum">    5172</span>              :    *  both ranges advance.  The output range may not overlap either input</span>
<span id="L5173"><span class="lineNum">    5173</span>              :    *  range.</span>
<span id="L5174"><span class="lineNum">    5174</span>              :   */</span>
<span id="L5175"><span class="lineNum">    5175</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5176"><span class="lineNum">    5176</span>              :            typename _OutputIterator&gt;</span>
<span id="L5177"><span class="lineNum">    5177</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5178"><span class="lineNum">    5178</span>              :     inline _OutputIterator</span>
<span id="L5179"><span class="lineNum">    5179</span>              :     set_union(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5180"><span class="lineNum">    5180</span>              :               _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5181"><span class="lineNum">    5181</span>              :               _OutputIterator __result)</span>
<span id="L5182"><span class="lineNum">    5182</span>              :     {</span>
<span id="L5183"><span class="lineNum">    5183</span>              :       // concept requirements</span>
<span id="L5184"><span class="lineNum">    5184</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5185"><span class="lineNum">    5185</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5186"><span class="lineNum">    5186</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5187"><span class="lineNum">    5187</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5188"><span class="lineNum">    5188</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5189"><span class="lineNum">    5189</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5190"><span class="lineNum">    5190</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5191"><span class="lineNum">    5191</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5192"><span class="lineNum">    5192</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5193"><span class="lineNum">    5193</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5194"><span class="lineNum">    5194</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5195"><span class="lineNum">    5195</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5196"><span class="lineNum">    5196</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L5197"><span class="lineNum">    5197</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L5198"><span class="lineNum">    5198</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L5199"><span class="lineNum">    5199</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L5200"><span class="lineNum">    5200</span>              : </span>
<span id="L5201"><span class="lineNum">    5201</span>              :       return _GLIBCXX_STD_A::__set_union(__first1, __last1,</span>
<span id="L5202"><span class="lineNum">    5202</span>              :                                 __first2, __last2, __result,</span>
<span id="L5203"><span class="lineNum">    5203</span>              :                                 __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5204"><span class="lineNum">    5204</span>              :     }</span>
<span id="L5205"><span class="lineNum">    5205</span>              : </span>
<span id="L5206"><span class="lineNum">    5206</span>              :   /**</span>
<span id="L5207"><span class="lineNum">    5207</span>              :    *  @brief Return the union of two sorted ranges using a comparison functor.</span>
<span id="L5208"><span class="lineNum">    5208</span>              :    *  @ingroup set_algorithms</span>
<span id="L5209"><span class="lineNum">    5209</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5210"><span class="lineNum">    5210</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5211"><span class="lineNum">    5211</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5212"><span class="lineNum">    5212</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5213"><span class="lineNum">    5213</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5214"><span class="lineNum">    5214</span>              :    *  @param  __comp    The comparison functor.</span>
<span id="L5215"><span class="lineNum">    5215</span>              :    *  @return  End of the output range.</span>
<span id="L5216"><span class="lineNum">    5216</span>              :    *  @ingroup set_algorithms</span>
<span id="L5217"><span class="lineNum">    5217</span>              :    *</span>
<span id="L5218"><span class="lineNum">    5218</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5219"><span class="lineNum">    5219</span>              :    *  each range in order to the output range.  Iterators increment for each</span>
<span id="L5220"><span class="lineNum">    5220</span>              :    *  range.  When the current element of one range is less than the other</span>
<span id="L5221"><span class="lineNum">    5221</span>              :    *  according to @p __comp, that element is copied and the iterator advanced.</span>
<span id="L5222"><span class="lineNum">    5222</span>              :    *  If an equivalent element according to @p __comp is contained in both</span>
<span id="L5223"><span class="lineNum">    5223</span>              :    *  ranges, the element from the first range is copied and both ranges</span>
<span id="L5224"><span class="lineNum">    5224</span>              :    *  advance.  The output range may not overlap either input range.</span>
<span id="L5225"><span class="lineNum">    5225</span>              :   */</span>
<span id="L5226"><span class="lineNum">    5226</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5227"><span class="lineNum">    5227</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L5228"><span class="lineNum">    5228</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5229"><span class="lineNum">    5229</span>              :     inline _OutputIterator</span>
<span id="L5230"><span class="lineNum">    5230</span>              :     set_union(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5231"><span class="lineNum">    5231</span>              :               _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5232"><span class="lineNum">    5232</span>              :               _OutputIterator __result, _Compare __comp)</span>
<span id="L5233"><span class="lineNum">    5233</span>              :     {</span>
<span id="L5234"><span class="lineNum">    5234</span>              :       // concept requirements</span>
<span id="L5235"><span class="lineNum">    5235</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5236"><span class="lineNum">    5236</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5237"><span class="lineNum">    5237</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5238"><span class="lineNum">    5238</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5239"><span class="lineNum">    5239</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5240"><span class="lineNum">    5240</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5241"><span class="lineNum">    5241</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5242"><span class="lineNum">    5242</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5243"><span class="lineNum">    5243</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5244"><span class="lineNum">    5244</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5245"><span class="lineNum">    5245</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5246"><span class="lineNum">    5246</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5247"><span class="lineNum">    5247</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L5248"><span class="lineNum">    5248</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L5249"><span class="lineNum">    5249</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L5250"><span class="lineNum">    5250</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L5251"><span class="lineNum">    5251</span>              : </span>
<span id="L5252"><span class="lineNum">    5252</span>              :       return _GLIBCXX_STD_A::__set_union(__first1, __last1,</span>
<span id="L5253"><span class="lineNum">    5253</span>              :                                 __first2, __last2, __result,</span>
<span id="L5254"><span class="lineNum">    5254</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5255"><span class="lineNum">    5255</span>              :     }</span>
<span id="L5256"><span class="lineNum">    5256</span>              : </span>
<span id="L5257"><span class="lineNum">    5257</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5258"><span class="lineNum">    5258</span>              :            typename _OutputIterator,</span>
<span id="L5259"><span class="lineNum">    5259</span>              :            typename _Compare&gt;</span>
<span id="L5260"><span class="lineNum">    5260</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5261"><span class="lineNum">    5261</span>              :     _OutputIterator</span>
<span id="L5262"><span class="lineNum">    5262</span>              :     __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5263"><span class="lineNum">    5263</span>              :                        _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5264"><span class="lineNum">    5264</span>              :                        _OutputIterator __result, _Compare __comp)</span>
<span id="L5265"><span class="lineNum">    5265</span>              :     {</span>
<span id="L5266"><span class="lineNum">    5266</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L5267"><span class="lineNum">    5267</span>              :         if (__comp(__first1, __first2))</span>
<span id="L5268"><span class="lineNum">    5268</span>              :           ++__first1;</span>
<span id="L5269"><span class="lineNum">    5269</span>              :         else if (__comp(__first2, __first1))</span>
<span id="L5270"><span class="lineNum">    5270</span>              :           ++__first2;</span>
<span id="L5271"><span class="lineNum">    5271</span>              :         else</span>
<span id="L5272"><span class="lineNum">    5272</span>              :           {</span>
<span id="L5273"><span class="lineNum">    5273</span>              :             *__result = *__first1;</span>
<span id="L5274"><span class="lineNum">    5274</span>              :             ++__first1;</span>
<span id="L5275"><span class="lineNum">    5275</span>              :             ++__first2;</span>
<span id="L5276"><span class="lineNum">    5276</span>              :             ++__result;</span>
<span id="L5277"><span class="lineNum">    5277</span>              :           }</span>
<span id="L5278"><span class="lineNum">    5278</span>              :       return __result;</span>
<span id="L5279"><span class="lineNum">    5279</span>              :     }</span>
<span id="L5280"><span class="lineNum">    5280</span>              : </span>
<span id="L5281"><span class="lineNum">    5281</span>              :   /**</span>
<span id="L5282"><span class="lineNum">    5282</span>              :    *  @brief Return the intersection of two sorted ranges.</span>
<span id="L5283"><span class="lineNum">    5283</span>              :    *  @ingroup set_algorithms</span>
<span id="L5284"><span class="lineNum">    5284</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5285"><span class="lineNum">    5285</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5286"><span class="lineNum">    5286</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5287"><span class="lineNum">    5287</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5288"><span class="lineNum">    5288</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5289"><span class="lineNum">    5289</span>              :    *  @return  End of the output range.</span>
<span id="L5290"><span class="lineNum">    5290</span>              :    *  @ingroup set_algorithms</span>
<span id="L5291"><span class="lineNum">    5291</span>              :    *</span>
<span id="L5292"><span class="lineNum">    5292</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5293"><span class="lineNum">    5293</span>              :    *  both ranges in order to the output range.  Iterators increment for each</span>
<span id="L5294"><span class="lineNum">    5294</span>              :    *  range.  When the current element of one range is less than the other,</span>
<span id="L5295"><span class="lineNum">    5295</span>              :    *  that iterator advances.  If an element is contained in both ranges, the</span>
<span id="L5296"><span class="lineNum">    5296</span>              :    *  element from the first range is copied and both ranges advance.  The</span>
<span id="L5297"><span class="lineNum">    5297</span>              :    *  output range may not overlap either input range.</span>
<span id="L5298"><span class="lineNum">    5298</span>              :   */</span>
<span id="L5299"><span class="lineNum">    5299</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5300"><span class="lineNum">    5300</span>              :            typename _OutputIterator&gt;</span>
<span id="L5301"><span class="lineNum">    5301</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5302"><span class="lineNum">    5302</span>              :     inline _OutputIterator</span>
<span id="L5303"><span class="lineNum">    5303</span>              :     set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5304"><span class="lineNum">    5304</span>              :                      _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5305"><span class="lineNum">    5305</span>              :                      _OutputIterator __result)</span>
<span id="L5306"><span class="lineNum">    5306</span>              :     {</span>
<span id="L5307"><span class="lineNum">    5307</span>              :       // concept requirements</span>
<span id="L5308"><span class="lineNum">    5308</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5309"><span class="lineNum">    5309</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5310"><span class="lineNum">    5310</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5311"><span class="lineNum">    5311</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5312"><span class="lineNum">    5312</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5313"><span class="lineNum">    5313</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5314"><span class="lineNum">    5314</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5315"><span class="lineNum">    5315</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5316"><span class="lineNum">    5316</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5317"><span class="lineNum">    5317</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5318"><span class="lineNum">    5318</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L5319"><span class="lineNum">    5319</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L5320"><span class="lineNum">    5320</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L5321"><span class="lineNum">    5321</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L5322"><span class="lineNum">    5322</span>              : </span>
<span id="L5323"><span class="lineNum">    5323</span>              :       return _GLIBCXX_STD_A::__set_intersection(__first1, __last1,</span>
<span id="L5324"><span class="lineNum">    5324</span>              :                                      __first2, __last2, __result,</span>
<span id="L5325"><span class="lineNum">    5325</span>              :                                      __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5326"><span class="lineNum">    5326</span>              :     }</span>
<span id="L5327"><span class="lineNum">    5327</span>              : </span>
<span id="L5328"><span class="lineNum">    5328</span>              :   /**</span>
<span id="L5329"><span class="lineNum">    5329</span>              :    *  @brief Return the intersection of two sorted ranges using comparison</span>
<span id="L5330"><span class="lineNum">    5330</span>              :    *  functor.</span>
<span id="L5331"><span class="lineNum">    5331</span>              :    *  @ingroup set_algorithms</span>
<span id="L5332"><span class="lineNum">    5332</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5333"><span class="lineNum">    5333</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5334"><span class="lineNum">    5334</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5335"><span class="lineNum">    5335</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5336"><span class="lineNum">    5336</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5337"><span class="lineNum">    5337</span>              :    *  @param  __comp    The comparison functor.</span>
<span id="L5338"><span class="lineNum">    5338</span>              :    *  @return  End of the output range.</span>
<span id="L5339"><span class="lineNum">    5339</span>              :    *  @ingroup set_algorithms</span>
<span id="L5340"><span class="lineNum">    5340</span>              :    *</span>
<span id="L5341"><span class="lineNum">    5341</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5342"><span class="lineNum">    5342</span>              :    *  both ranges in order to the output range.  Iterators increment for each</span>
<span id="L5343"><span class="lineNum">    5343</span>              :    *  range.  When the current element of one range is less than the other</span>
<span id="L5344"><span class="lineNum">    5344</span>              :    *  according to @p __comp, that iterator advances.  If an element is</span>
<span id="L5345"><span class="lineNum">    5345</span>              :    *  contained in both ranges according to @p __comp, the element from the</span>
<span id="L5346"><span class="lineNum">    5346</span>              :    *  first range is copied and both ranges advance.  The output range may not</span>
<span id="L5347"><span class="lineNum">    5347</span>              :    *  overlap either input range.</span>
<span id="L5348"><span class="lineNum">    5348</span>              :   */</span>
<span id="L5349"><span class="lineNum">    5349</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5350"><span class="lineNum">    5350</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L5351"><span class="lineNum">    5351</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5352"><span class="lineNum">    5352</span>              :     inline _OutputIterator</span>
<span id="L5353"><span class="lineNum">    5353</span>              :     set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5354"><span class="lineNum">    5354</span>              :                      _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5355"><span class="lineNum">    5355</span>              :                      _OutputIterator __result, _Compare __comp)</span>
<span id="L5356"><span class="lineNum">    5356</span>              :     {</span>
<span id="L5357"><span class="lineNum">    5357</span>              :       // concept requirements</span>
<span id="L5358"><span class="lineNum">    5358</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5359"><span class="lineNum">    5359</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5360"><span class="lineNum">    5360</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5361"><span class="lineNum">    5361</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5362"><span class="lineNum">    5362</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5363"><span class="lineNum">    5363</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5364"><span class="lineNum">    5364</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5365"><span class="lineNum">    5365</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5366"><span class="lineNum">    5366</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5367"><span class="lineNum">    5367</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5368"><span class="lineNum">    5368</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L5369"><span class="lineNum">    5369</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L5370"><span class="lineNum">    5370</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L5371"><span class="lineNum">    5371</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L5372"><span class="lineNum">    5372</span>              : </span>
<span id="L5373"><span class="lineNum">    5373</span>              :       return _GLIBCXX_STD_A::__set_intersection(__first1, __last1,</span>
<span id="L5374"><span class="lineNum">    5374</span>              :                                 __first2, __last2, __result,</span>
<span id="L5375"><span class="lineNum">    5375</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5376"><span class="lineNum">    5376</span>              :     }</span>
<span id="L5377"><span class="lineNum">    5377</span>              : </span>
<span id="L5378"><span class="lineNum">    5378</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5379"><span class="lineNum">    5379</span>              :            typename _OutputIterator,</span>
<span id="L5380"><span class="lineNum">    5380</span>              :            typename _Compare&gt;</span>
<span id="L5381"><span class="lineNum">    5381</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5382"><span class="lineNum">    5382</span>              :     _OutputIterator</span>
<span id="L5383"><span class="lineNum">    5383</span>              :     __set_difference(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5384"><span class="lineNum">    5384</span>              :                      _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5385"><span class="lineNum">    5385</span>              :                      _OutputIterator __result, _Compare __comp)</span>
<span id="L5386"><span class="lineNum">    5386</span>              :     {</span>
<span id="L5387"><span class="lineNum">    5387</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L5388"><span class="lineNum">    5388</span>              :         if (__comp(__first1, __first2))</span>
<span id="L5389"><span class="lineNum">    5389</span>              :           {</span>
<span id="L5390"><span class="lineNum">    5390</span>              :             *__result = *__first1;</span>
<span id="L5391"><span class="lineNum">    5391</span>              :             ++__first1;</span>
<span id="L5392"><span class="lineNum">    5392</span>              :             ++__result;</span>
<span id="L5393"><span class="lineNum">    5393</span>              :           }</span>
<span id="L5394"><span class="lineNum">    5394</span>              :         else if (__comp(__first2, __first1))</span>
<span id="L5395"><span class="lineNum">    5395</span>              :           ++__first2;</span>
<span id="L5396"><span class="lineNum">    5396</span>              :         else</span>
<span id="L5397"><span class="lineNum">    5397</span>              :           {</span>
<span id="L5398"><span class="lineNum">    5398</span>              :             ++__first1;</span>
<span id="L5399"><span class="lineNum">    5399</span>              :             ++__first2;</span>
<span id="L5400"><span class="lineNum">    5400</span>              :           }</span>
<span id="L5401"><span class="lineNum">    5401</span>              :       return std::copy(__first1, __last1, __result);</span>
<span id="L5402"><span class="lineNum">    5402</span>              :     }</span>
<span id="L5403"><span class="lineNum">    5403</span>              : </span>
<span id="L5404"><span class="lineNum">    5404</span>              :   /**</span>
<span id="L5405"><span class="lineNum">    5405</span>              :    *  @brief Return the difference of two sorted ranges.</span>
<span id="L5406"><span class="lineNum">    5406</span>              :    *  @ingroup set_algorithms</span>
<span id="L5407"><span class="lineNum">    5407</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5408"><span class="lineNum">    5408</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5409"><span class="lineNum">    5409</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5410"><span class="lineNum">    5410</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5411"><span class="lineNum">    5411</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5412"><span class="lineNum">    5412</span>              :    *  @return  End of the output range.</span>
<span id="L5413"><span class="lineNum">    5413</span>              :    *  @ingroup set_algorithms</span>
<span id="L5414"><span class="lineNum">    5414</span>              :    *</span>
<span id="L5415"><span class="lineNum">    5415</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5416"><span class="lineNum">    5416</span>              :    *  the first range but not the second in order to the output range.</span>
<span id="L5417"><span class="lineNum">    5417</span>              :    *  Iterators increment for each range.  When the current element of the</span>
<span id="L5418"><span class="lineNum">    5418</span>              :    *  first range is less than the second, that element is copied and the</span>
<span id="L5419"><span class="lineNum">    5419</span>              :    *  iterator advances.  If the current element of the second range is less,</span>
<span id="L5420"><span class="lineNum">    5420</span>              :    *  the iterator advances, but no element is copied.  If an element is</span>
<span id="L5421"><span class="lineNum">    5421</span>              :    *  contained in both ranges, no elements are copied and both ranges</span>
<span id="L5422"><span class="lineNum">    5422</span>              :    *  advance.  The output range may not overlap either input range.</span>
<span id="L5423"><span class="lineNum">    5423</span>              :   */</span>
<span id="L5424"><span class="lineNum">    5424</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5425"><span class="lineNum">    5425</span>              :            typename _OutputIterator&gt;</span>
<span id="L5426"><span class="lineNum">    5426</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5427"><span class="lineNum">    5427</span>              :     inline _OutputIterator</span>
<span id="L5428"><span class="lineNum">    5428</span>              :     set_difference(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5429"><span class="lineNum">    5429</span>              :                    _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5430"><span class="lineNum">    5430</span>              :                    _OutputIterator __result)</span>
<span id="L5431"><span class="lineNum">    5431</span>              :     {</span>
<span id="L5432"><span class="lineNum">    5432</span>              :       // concept requirements</span>
<span id="L5433"><span class="lineNum">    5433</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5434"><span class="lineNum">    5434</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5435"><span class="lineNum">    5435</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5436"><span class="lineNum">    5436</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5437"><span class="lineNum">    5437</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5438"><span class="lineNum">    5438</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5439"><span class="lineNum">    5439</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5440"><span class="lineNum">    5440</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5441"><span class="lineNum">    5441</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5442"><span class="lineNum">    5442</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)    </span>
<span id="L5443"><span class="lineNum">    5443</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L5444"><span class="lineNum">    5444</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L5445"><span class="lineNum">    5445</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L5446"><span class="lineNum">    5446</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L5447"><span class="lineNum">    5447</span>              : </span>
<span id="L5448"><span class="lineNum">    5448</span>              :       return _GLIBCXX_STD_A::__set_difference(__first1, __last1,</span>
<span id="L5449"><span class="lineNum">    5449</span>              :                                    __first2, __last2, __result,</span>
<span id="L5450"><span class="lineNum">    5450</span>              :                                    __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5451"><span class="lineNum">    5451</span>              :     }</span>
<span id="L5452"><span class="lineNum">    5452</span>              : </span>
<span id="L5453"><span class="lineNum">    5453</span>              :   /**</span>
<span id="L5454"><span class="lineNum">    5454</span>              :    *  @brief  Return the difference of two sorted ranges using comparison</span>
<span id="L5455"><span class="lineNum">    5455</span>              :    *  functor.</span>
<span id="L5456"><span class="lineNum">    5456</span>              :    *  @ingroup set_algorithms</span>
<span id="L5457"><span class="lineNum">    5457</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5458"><span class="lineNum">    5458</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5459"><span class="lineNum">    5459</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5460"><span class="lineNum">    5460</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5461"><span class="lineNum">    5461</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5462"><span class="lineNum">    5462</span>              :    *  @param  __comp    The comparison functor.</span>
<span id="L5463"><span class="lineNum">    5463</span>              :    *  @return  End of the output range.</span>
<span id="L5464"><span class="lineNum">    5464</span>              :    *  @ingroup set_algorithms</span>
<span id="L5465"><span class="lineNum">    5465</span>              :    *</span>
<span id="L5466"><span class="lineNum">    5466</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5467"><span class="lineNum">    5467</span>              :    *  the first range but not the second in order to the output range.</span>
<span id="L5468"><span class="lineNum">    5468</span>              :    *  Iterators increment for each range.  When the current element of the</span>
<span id="L5469"><span class="lineNum">    5469</span>              :    *  first range is less than the second according to @p __comp, that element</span>
<span id="L5470"><span class="lineNum">    5470</span>              :    *  is copied and the iterator advances.  If the current element of the</span>
<span id="L5471"><span class="lineNum">    5471</span>              :    *  second range is less, no element is copied and the iterator advances.</span>
<span id="L5472"><span class="lineNum">    5472</span>              :    *  If an element is contained in both ranges according to @p __comp, no</span>
<span id="L5473"><span class="lineNum">    5473</span>              :    *  elements are copied and both ranges advance.  The output range may not</span>
<span id="L5474"><span class="lineNum">    5474</span>              :    *  overlap either input range.</span>
<span id="L5475"><span class="lineNum">    5475</span>              :   */</span>
<span id="L5476"><span class="lineNum">    5476</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5477"><span class="lineNum">    5477</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L5478"><span class="lineNum">    5478</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5479"><span class="lineNum">    5479</span>              :     inline _OutputIterator</span>
<span id="L5480"><span class="lineNum">    5480</span>              :     set_difference(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5481"><span class="lineNum">    5481</span>              :                    _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5482"><span class="lineNum">    5482</span>              :                    _OutputIterator __result, _Compare __comp)</span>
<span id="L5483"><span class="lineNum">    5483</span>              :     {</span>
<span id="L5484"><span class="lineNum">    5484</span>              :       // concept requirements</span>
<span id="L5485"><span class="lineNum">    5485</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5486"><span class="lineNum">    5486</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5487"><span class="lineNum">    5487</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5488"><span class="lineNum">    5488</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5489"><span class="lineNum">    5489</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5490"><span class="lineNum">    5490</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5491"><span class="lineNum">    5491</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5492"><span class="lineNum">    5492</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5493"><span class="lineNum">    5493</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5494"><span class="lineNum">    5494</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5495"><span class="lineNum">    5495</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L5496"><span class="lineNum">    5496</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L5497"><span class="lineNum">    5497</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L5498"><span class="lineNum">    5498</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L5499"><span class="lineNum">    5499</span>              : </span>
<span id="L5500"><span class="lineNum">    5500</span>              :       return _GLIBCXX_STD_A::__set_difference(__first1, __last1,</span>
<span id="L5501"><span class="lineNum">    5501</span>              :                                    __first2, __last2, __result,</span>
<span id="L5502"><span class="lineNum">    5502</span>              :                                    __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5503"><span class="lineNum">    5503</span>              :     }</span>
<span id="L5504"><span class="lineNum">    5504</span>              : </span>
<span id="L5505"><span class="lineNum">    5505</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5506"><span class="lineNum">    5506</span>              :            typename _OutputIterator,</span>
<span id="L5507"><span class="lineNum">    5507</span>              :            typename _Compare&gt;</span>
<span id="L5508"><span class="lineNum">    5508</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5509"><span class="lineNum">    5509</span>              :     _OutputIterator</span>
<span id="L5510"><span class="lineNum">    5510</span>              :     __set_symmetric_difference(_InputIterator1 __first1,</span>
<span id="L5511"><span class="lineNum">    5511</span>              :                                _InputIterator1 __last1,</span>
<span id="L5512"><span class="lineNum">    5512</span>              :                                _InputIterator2 __first2,</span>
<span id="L5513"><span class="lineNum">    5513</span>              :                                _InputIterator2 __last2,</span>
<span id="L5514"><span class="lineNum">    5514</span>              :                                _OutputIterator __result,</span>
<span id="L5515"><span class="lineNum">    5515</span>              :                                _Compare __comp)</span>
<span id="L5516"><span class="lineNum">    5516</span>              :     {</span>
<span id="L5517"><span class="lineNum">    5517</span>              :       while (__first1 != __last1 &amp;&amp; __first2 != __last2)</span>
<span id="L5518"><span class="lineNum">    5518</span>              :         if (__comp(__first1, __first2))</span>
<span id="L5519"><span class="lineNum">    5519</span>              :           {</span>
<span id="L5520"><span class="lineNum">    5520</span>              :             *__result = *__first1;</span>
<span id="L5521"><span class="lineNum">    5521</span>              :             ++__first1;</span>
<span id="L5522"><span class="lineNum">    5522</span>              :             ++__result;</span>
<span id="L5523"><span class="lineNum">    5523</span>              :           }</span>
<span id="L5524"><span class="lineNum">    5524</span>              :         else if (__comp(__first2, __first1))</span>
<span id="L5525"><span class="lineNum">    5525</span>              :           {</span>
<span id="L5526"><span class="lineNum">    5526</span>              :             *__result = *__first2;</span>
<span id="L5527"><span class="lineNum">    5527</span>              :             ++__first2;</span>
<span id="L5528"><span class="lineNum">    5528</span>              :             ++__result;</span>
<span id="L5529"><span class="lineNum">    5529</span>              :           }</span>
<span id="L5530"><span class="lineNum">    5530</span>              :         else</span>
<span id="L5531"><span class="lineNum">    5531</span>              :           {</span>
<span id="L5532"><span class="lineNum">    5532</span>              :             ++__first1;</span>
<span id="L5533"><span class="lineNum">    5533</span>              :             ++__first2;</span>
<span id="L5534"><span class="lineNum">    5534</span>              :           }</span>
<span id="L5535"><span class="lineNum">    5535</span>              :       return std::copy(__first2, __last2, </span>
<span id="L5536"><span class="lineNum">    5536</span>              :                        std::copy(__first1, __last1, __result));</span>
<span id="L5537"><span class="lineNum">    5537</span>              :     }</span>
<span id="L5538"><span class="lineNum">    5538</span>              : </span>
<span id="L5539"><span class="lineNum">    5539</span>              :   /**</span>
<span id="L5540"><span class="lineNum">    5540</span>              :    *  @brief  Return the symmetric difference of two sorted ranges.</span>
<span id="L5541"><span class="lineNum">    5541</span>              :    *  @ingroup set_algorithms</span>
<span id="L5542"><span class="lineNum">    5542</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5543"><span class="lineNum">    5543</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5544"><span class="lineNum">    5544</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5545"><span class="lineNum">    5545</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5546"><span class="lineNum">    5546</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5547"><span class="lineNum">    5547</span>              :    *  @return  End of the output range.</span>
<span id="L5548"><span class="lineNum">    5548</span>              :    *  @ingroup set_algorithms</span>
<span id="L5549"><span class="lineNum">    5549</span>              :    *</span>
<span id="L5550"><span class="lineNum">    5550</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5551"><span class="lineNum">    5551</span>              :    *  one range but not the other in order to the output range.  Iterators</span>
<span id="L5552"><span class="lineNum">    5552</span>              :    *  increment for each range.  When the current element of one range is less</span>
<span id="L5553"><span class="lineNum">    5553</span>              :    *  than the other, that element is copied and the iterator advances.  If an</span>
<span id="L5554"><span class="lineNum">    5554</span>              :    *  element is contained in both ranges, no elements are copied and both</span>
<span id="L5555"><span class="lineNum">    5555</span>              :    *  ranges advance.  The output range may not overlap either input range.</span>
<span id="L5556"><span class="lineNum">    5556</span>              :   */</span>
<span id="L5557"><span class="lineNum">    5557</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5558"><span class="lineNum">    5558</span>              :            typename _OutputIterator&gt;</span>
<span id="L5559"><span class="lineNum">    5559</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5560"><span class="lineNum">    5560</span>              :     inline _OutputIterator</span>
<span id="L5561"><span class="lineNum">    5561</span>              :     set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5562"><span class="lineNum">    5562</span>              :                              _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5563"><span class="lineNum">    5563</span>              :                              _OutputIterator __result)</span>
<span id="L5564"><span class="lineNum">    5564</span>              :     {</span>
<span id="L5565"><span class="lineNum">    5565</span>              :       // concept requirements</span>
<span id="L5566"><span class="lineNum">    5566</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5567"><span class="lineNum">    5567</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5568"><span class="lineNum">    5568</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5569"><span class="lineNum">    5569</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5570"><span class="lineNum">    5570</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5571"><span class="lineNum">    5571</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5572"><span class="lineNum">    5572</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5573"><span class="lineNum">    5573</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5574"><span class="lineNum">    5574</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5575"><span class="lineNum">    5575</span>              :       __glibcxx_function_requires(_LessThanOpConcept&lt;</span>
<span id="L5576"><span class="lineNum">    5576</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5577"><span class="lineNum">    5577</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)    </span>
<span id="L5578"><span class="lineNum">    5578</span>              :       __glibcxx_requires_sorted_set(__first1, __last1, __first2);</span>
<span id="L5579"><span class="lineNum">    5579</span>              :       __glibcxx_requires_sorted_set(__first2, __last2, __first1);</span>
<span id="L5580"><span class="lineNum">    5580</span>              :       __glibcxx_requires_irreflexive2(__first1, __last1);</span>
<span id="L5581"><span class="lineNum">    5581</span>              :       __glibcxx_requires_irreflexive2(__first2, __last2);</span>
<span id="L5582"><span class="lineNum">    5582</span>              : </span>
<span id="L5583"><span class="lineNum">    5583</span>              :       return _GLIBCXX_STD_A::__set_symmetric_difference(__first1, __last1,</span>
<span id="L5584"><span class="lineNum">    5584</span>              :                                         __first2, __last2, __result,</span>
<span id="L5585"><span class="lineNum">    5585</span>              :                                         __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5586"><span class="lineNum">    5586</span>              :     }</span>
<span id="L5587"><span class="lineNum">    5587</span>              : </span>
<span id="L5588"><span class="lineNum">    5588</span>              :   /**</span>
<span id="L5589"><span class="lineNum">    5589</span>              :    *  @brief  Return the symmetric difference of two sorted ranges using</span>
<span id="L5590"><span class="lineNum">    5590</span>              :    *  comparison functor.</span>
<span id="L5591"><span class="lineNum">    5591</span>              :    *  @ingroup set_algorithms</span>
<span id="L5592"><span class="lineNum">    5592</span>              :    *  @param  __first1  Start of first range.</span>
<span id="L5593"><span class="lineNum">    5593</span>              :    *  @param  __last1   End of first range.</span>
<span id="L5594"><span class="lineNum">    5594</span>              :    *  @param  __first2  Start of second range.</span>
<span id="L5595"><span class="lineNum">    5595</span>              :    *  @param  __last2   End of second range.</span>
<span id="L5596"><span class="lineNum">    5596</span>              :    *  @param  __result  Start of output range.</span>
<span id="L5597"><span class="lineNum">    5597</span>              :    *  @param  __comp    The comparison functor.</span>
<span id="L5598"><span class="lineNum">    5598</span>              :    *  @return  End of the output range.</span>
<span id="L5599"><span class="lineNum">    5599</span>              :    *  @ingroup set_algorithms</span>
<span id="L5600"><span class="lineNum">    5600</span>              :    *</span>
<span id="L5601"><span class="lineNum">    5601</span>              :    *  This operation iterates over both ranges, copying elements present in</span>
<span id="L5602"><span class="lineNum">    5602</span>              :    *  one range but not the other in order to the output range.  Iterators</span>
<span id="L5603"><span class="lineNum">    5603</span>              :    *  increment for each range.  When the current element of one range is less</span>
<span id="L5604"><span class="lineNum">    5604</span>              :    *  than the other according to @p comp, that element is copied and the</span>
<span id="L5605"><span class="lineNum">    5605</span>              :    *  iterator advances.  If an element is contained in both ranges according</span>
<span id="L5606"><span class="lineNum">    5606</span>              :    *  to @p __comp, no elements are copied and both ranges advance.  The output</span>
<span id="L5607"><span class="lineNum">    5607</span>              :    *  range may not overlap either input range.</span>
<span id="L5608"><span class="lineNum">    5608</span>              :   */</span>
<span id="L5609"><span class="lineNum">    5609</span>              :   template&lt;typename _InputIterator1, typename _InputIterator2,</span>
<span id="L5610"><span class="lineNum">    5610</span>              :            typename _OutputIterator, typename _Compare&gt;</span>
<span id="L5611"><span class="lineNum">    5611</span>              :     _GLIBCXX20_CONSTEXPR</span>
<span id="L5612"><span class="lineNum">    5612</span>              :     inline _OutputIterator</span>
<span id="L5613"><span class="lineNum">    5613</span>              :     set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,</span>
<span id="L5614"><span class="lineNum">    5614</span>              :                              _InputIterator2 __first2, _InputIterator2 __last2,</span>
<span id="L5615"><span class="lineNum">    5615</span>              :                              _OutputIterator __result,</span>
<span id="L5616"><span class="lineNum">    5616</span>              :                              _Compare __comp)</span>
<span id="L5617"><span class="lineNum">    5617</span>              :     {</span>
<span id="L5618"><span class="lineNum">    5618</span>              :       // concept requirements</span>
<span id="L5619"><span class="lineNum">    5619</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator1&gt;)</span>
<span id="L5620"><span class="lineNum">    5620</span>              :       __glibcxx_function_requires(_InputIteratorConcept&lt;_InputIterator2&gt;)</span>
<span id="L5621"><span class="lineNum">    5621</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5622"><span class="lineNum">    5622</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5623"><span class="lineNum">    5623</span>              :       __glibcxx_function_requires(_OutputIteratorConcept&lt;_OutputIterator,</span>
<span id="L5624"><span class="lineNum">    5624</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5625"><span class="lineNum">    5625</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5626"><span class="lineNum">    5626</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type,</span>
<span id="L5627"><span class="lineNum">    5627</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type&gt;)</span>
<span id="L5628"><span class="lineNum">    5628</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5629"><span class="lineNum">    5629</span>              :             typename iterator_traits&lt;_InputIterator2&gt;::value_type,</span>
<span id="L5630"><span class="lineNum">    5630</span>              :             typename iterator_traits&lt;_InputIterator1&gt;::value_type&gt;)</span>
<span id="L5631"><span class="lineNum">    5631</span>              :       __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);</span>
<span id="L5632"><span class="lineNum">    5632</span>              :       __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);</span>
<span id="L5633"><span class="lineNum">    5633</span>              :       __glibcxx_requires_irreflexive_pred2(__first1, __last1, __comp);</span>
<span id="L5634"><span class="lineNum">    5634</span>              :       __glibcxx_requires_irreflexive_pred2(__first2, __last2, __comp);</span>
<span id="L5635"><span class="lineNum">    5635</span>              : </span>
<span id="L5636"><span class="lineNum">    5636</span>              :       return _GLIBCXX_STD_A::__set_symmetric_difference(__first1, __last1,</span>
<span id="L5637"><span class="lineNum">    5637</span>              :                                 __first2, __last2, __result,</span>
<span id="L5638"><span class="lineNum">    5638</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5639"><span class="lineNum">    5639</span>              :     }</span>
<span id="L5640"><span class="lineNum">    5640</span>              : </span>
<span id="L5641"><span class="lineNum">    5641</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L5642"><span class="lineNum">    5642</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5643"><span class="lineNum">    5643</span>              :     _ForwardIterator</span>
<span id="L5644"><span class="lineNum">    5644</span>              :     __min_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L5645"><span class="lineNum">    5645</span>              :                   _Compare __comp)</span>
<span id="L5646"><span class="lineNum">    5646</span>              :     {</span>
<span id="L5647"><span class="lineNum">    5647</span>              :       if (__first == __last)</span>
<span id="L5648"><span class="lineNum">    5648</span>              :         return __first;</span>
<span id="L5649"><span class="lineNum">    5649</span>              :       _ForwardIterator __result = __first;</span>
<span id="L5650"><span class="lineNum">    5650</span>              :       while (++__first != __last)</span>
<span id="L5651"><span class="lineNum">    5651</span>              :         if (__comp(__first, __result))</span>
<span id="L5652"><span class="lineNum">    5652</span>              :           __result = __first;</span>
<span id="L5653"><span class="lineNum">    5653</span>              :       return __result;</span>
<span id="L5654"><span class="lineNum">    5654</span>              :     }</span>
<span id="L5655"><span class="lineNum">    5655</span>              : </span>
<span id="L5656"><span class="lineNum">    5656</span>              :   /**</span>
<span id="L5657"><span class="lineNum">    5657</span>              :    *  @brief  Return the minimum element in a range.</span>
<span id="L5658"><span class="lineNum">    5658</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5659"><span class="lineNum">    5659</span>              :    *  @param  __first  Start of range.</span>
<span id="L5660"><span class="lineNum">    5660</span>              :    *  @param  __last   End of range.</span>
<span id="L5661"><span class="lineNum">    5661</span>              :    *  @return  Iterator referencing the first instance of the smallest value.</span>
<span id="L5662"><span class="lineNum">    5662</span>              :   */</span>
<span id="L5663"><span class="lineNum">    5663</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L5664"><span class="lineNum">    5664</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5665"><span class="lineNum">    5665</span>              :     _ForwardIterator</span>
<span id="L5666"><span class="lineNum">    5666</span>              :     inline min_element(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L5667"><span class="lineNum">    5667</span>              :     {</span>
<span id="L5668"><span class="lineNum">    5668</span>              :       // concept requirements</span>
<span id="L5669"><span class="lineNum">    5669</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L5670"><span class="lineNum">    5670</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L5671"><span class="lineNum">    5671</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L5672"><span class="lineNum">    5672</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5673"><span class="lineNum">    5673</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L5674"><span class="lineNum">    5674</span>              : </span>
<span id="L5675"><span class="lineNum">    5675</span>              :       return _GLIBCXX_STD_A::__min_element(__first, __last,</span>
<span id="L5676"><span class="lineNum">    5676</span>              :                                 __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5677"><span class="lineNum">    5677</span>              :     }</span>
<span id="L5678"><span class="lineNum">    5678</span>              : </span>
<span id="L5679"><span class="lineNum">    5679</span>              :   /**</span>
<span id="L5680"><span class="lineNum">    5680</span>              :    *  @brief  Return the minimum element in a range using comparison functor.</span>
<span id="L5681"><span class="lineNum">    5681</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5682"><span class="lineNum">    5682</span>              :    *  @param  __first  Start of range.</span>
<span id="L5683"><span class="lineNum">    5683</span>              :    *  @param  __last   End of range.</span>
<span id="L5684"><span class="lineNum">    5684</span>              :    *  @param  __comp   Comparison functor.</span>
<span id="L5685"><span class="lineNum">    5685</span>              :    *  @return  Iterator referencing the first instance of the smallest value</span>
<span id="L5686"><span class="lineNum">    5686</span>              :    *  according to __comp.</span>
<span id="L5687"><span class="lineNum">    5687</span>              :   */</span>
<span id="L5688"><span class="lineNum">    5688</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L5689"><span class="lineNum">    5689</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5690"><span class="lineNum">    5690</span>              :     inline _ForwardIterator</span>
<span id="L5691"><span class="lineNum">    5691</span>              :     min_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L5692"><span class="lineNum">    5692</span>              :                 _Compare __comp)</span>
<span id="L5693"><span class="lineNum">    5693</span>              :     {</span>
<span id="L5694"><span class="lineNum">    5694</span>              :       // concept requirements</span>
<span id="L5695"><span class="lineNum">    5695</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L5696"><span class="lineNum">    5696</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5697"><span class="lineNum">    5697</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L5698"><span class="lineNum">    5698</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L5699"><span class="lineNum">    5699</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5700"><span class="lineNum">    5700</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L5701"><span class="lineNum">    5701</span>              : </span>
<span id="L5702"><span class="lineNum">    5702</span>              :       return _GLIBCXX_STD_A::__min_element(__first, __last,</span>
<span id="L5703"><span class="lineNum">    5703</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5704"><span class="lineNum">    5704</span>              :     }</span>
<span id="L5705"><span class="lineNum">    5705</span>              : </span>
<span id="L5706"><span class="lineNum">    5706</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L5707"><span class="lineNum">    5707</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5708"><span class="lineNum">    5708</span>              :     _ForwardIterator</span>
<span id="L5709"><span class="lineNum">    5709</span>              :     __max_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L5710"><span class="lineNum">    5710</span>              :                   _Compare __comp)</span>
<span id="L5711"><span class="lineNum">    5711</span>              :     {</span>
<span id="L5712"><span class="lineNum">    5712</span>              :       if (__first == __last) return __first;</span>
<span id="L5713"><span class="lineNum">    5713</span>              :       _ForwardIterator __result = __first;</span>
<span id="L5714"><span class="lineNum">    5714</span>              :       while (++__first != __last)</span>
<span id="L5715"><span class="lineNum">    5715</span>              :         if (__comp(__result, __first))</span>
<span id="L5716"><span class="lineNum">    5716</span>              :           __result = __first;</span>
<span id="L5717"><span class="lineNum">    5717</span>              :       return __result;</span>
<span id="L5718"><span class="lineNum">    5718</span>              :     }</span>
<span id="L5719"><span class="lineNum">    5719</span>              : </span>
<span id="L5720"><span class="lineNum">    5720</span>              :   /**</span>
<span id="L5721"><span class="lineNum">    5721</span>              :    *  @brief  Return the maximum element in a range.</span>
<span id="L5722"><span class="lineNum">    5722</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5723"><span class="lineNum">    5723</span>              :    *  @param  __first  Start of range.</span>
<span id="L5724"><span class="lineNum">    5724</span>              :    *  @param  __last   End of range.</span>
<span id="L5725"><span class="lineNum">    5725</span>              :    *  @return  Iterator referencing the first instance of the largest value.</span>
<span id="L5726"><span class="lineNum">    5726</span>              :   */</span>
<span id="L5727"><span class="lineNum">    5727</span>              :   template&lt;typename _ForwardIterator&gt;</span>
<span id="L5728"><span class="lineNum">    5728</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5729"><span class="lineNum">    5729</span>              :     inline _ForwardIterator</span>
<span id="L5730"><span class="lineNum">    5730</span>              :     max_element(_ForwardIterator __first, _ForwardIterator __last)</span>
<span id="L5731"><span class="lineNum">    5731</span>              :     {</span>
<span id="L5732"><span class="lineNum">    5732</span>              :       // concept requirements</span>
<span id="L5733"><span class="lineNum">    5733</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L5734"><span class="lineNum">    5734</span>              :       __glibcxx_function_requires(_LessThanComparableConcept&lt;</span>
<span id="L5735"><span class="lineNum">    5735</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L5736"><span class="lineNum">    5736</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5737"><span class="lineNum">    5737</span>              :       __glibcxx_requires_irreflexive(__first, __last);</span>
<span id="L5738"><span class="lineNum">    5738</span>              : </span>
<span id="L5739"><span class="lineNum">    5739</span>              :       return _GLIBCXX_STD_A::__max_element(__first, __last,</span>
<span id="L5740"><span class="lineNum">    5740</span>              :                                 __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5741"><span class="lineNum">    5741</span>              :     }</span>
<span id="L5742"><span class="lineNum">    5742</span>              : </span>
<span id="L5743"><span class="lineNum">    5743</span>              :   /**</span>
<span id="L5744"><span class="lineNum">    5744</span>              :    *  @brief  Return the maximum element in a range using comparison functor.</span>
<span id="L5745"><span class="lineNum">    5745</span>              :    *  @ingroup sorting_algorithms</span>
<span id="L5746"><span class="lineNum">    5746</span>              :    *  @param  __first  Start of range.</span>
<span id="L5747"><span class="lineNum">    5747</span>              :    *  @param  __last   End of range.</span>
<span id="L5748"><span class="lineNum">    5748</span>              :    *  @param  __comp   Comparison functor.</span>
<span id="L5749"><span class="lineNum">    5749</span>              :    *  @return  Iterator referencing the first instance of the largest value</span>
<span id="L5750"><span class="lineNum">    5750</span>              :    *  according to __comp.</span>
<span id="L5751"><span class="lineNum">    5751</span>              :   */</span>
<span id="L5752"><span class="lineNum">    5752</span>              :   template&lt;typename _ForwardIterator, typename _Compare&gt;</span>
<span id="L5753"><span class="lineNum">    5753</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5754"><span class="lineNum">    5754</span>              :     inline _ForwardIterator</span>
<span id="L5755"><span class="lineNum">    5755</span>              :     max_element(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L5756"><span class="lineNum">    5756</span>              :                 _Compare __comp)</span>
<span id="L5757"><span class="lineNum">    5757</span>              :     {</span>
<span id="L5758"><span class="lineNum">    5758</span>              :       // concept requirements</span>
<span id="L5759"><span class="lineNum">    5759</span>              :       __glibcxx_function_requires(_ForwardIteratorConcept&lt;_ForwardIterator&gt;)</span>
<span id="L5760"><span class="lineNum">    5760</span>              :       __glibcxx_function_requires(_BinaryPredicateConcept&lt;_Compare,</span>
<span id="L5761"><span class="lineNum">    5761</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type,</span>
<span id="L5762"><span class="lineNum">    5762</span>              :             typename iterator_traits&lt;_ForwardIterator&gt;::value_type&gt;)</span>
<span id="L5763"><span class="lineNum">    5763</span>              :       __glibcxx_requires_valid_range(__first, __last);</span>
<span id="L5764"><span class="lineNum">    5764</span>              :       __glibcxx_requires_irreflexive_pred(__first, __last, __comp);</span>
<span id="L5765"><span class="lineNum">    5765</span>              : </span>
<span id="L5766"><span class="lineNum">    5766</span>              :       return _GLIBCXX_STD_A::__max_element(__first, __last,</span>
<span id="L5767"><span class="lineNum">    5767</span>              :                                 __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5768"><span class="lineNum">    5768</span>              :     }</span>
<span id="L5769"><span class="lineNum">    5769</span>              : </span>
<span id="L5770"><span class="lineNum">    5770</span>              : #if __cplusplus &gt;= 201103L</span>
<span id="L5771"><span class="lineNum">    5771</span>              :   // N2722 + DR 915.</span>
<span id="L5772"><span class="lineNum">    5772</span>              :   template&lt;typename _Tp&gt;</span>
<span id="L5773"><span class="lineNum">    5773</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5774"><span class="lineNum">    5774</span>              :     inline _Tp</span>
<span id="L5775"><span class="lineNum">    5775</span>              :     min(initializer_list&lt;_Tp&gt; __l)</span>
<span id="L5776"><span class="lineNum">    5776</span>              :     {</span>
<span id="L5777"><span class="lineNum">    5777</span>              :       __glibcxx_requires_irreflexive(__l.begin(), __l.end());</span>
<span id="L5778"><span class="lineNum">    5778</span>              :       return *_GLIBCXX_STD_A::__min_element(__l.begin(), __l.end(),</span>
<span id="L5779"><span class="lineNum">    5779</span>              :           __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5780"><span class="lineNum">    5780</span>              :     }</span>
<span id="L5781"><span class="lineNum">    5781</span>              : </span>
<span id="L5782"><span class="lineNum">    5782</span>              :   template&lt;typename _Tp, typename _Compare&gt;</span>
<span id="L5783"><span class="lineNum">    5783</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5784"><span class="lineNum">    5784</span>              :     inline _Tp</span>
<span id="L5785"><span class="lineNum">    5785</span>              :     min(initializer_list&lt;_Tp&gt; __l, _Compare __comp)</span>
<span id="L5786"><span class="lineNum">    5786</span>              :     {</span>
<span id="L5787"><span class="lineNum">    5787</span>              :       __glibcxx_requires_irreflexive_pred(__l.begin(), __l.end(), __comp);</span>
<span id="L5788"><span class="lineNum">    5788</span>              :       return *_GLIBCXX_STD_A::__min_element(__l.begin(), __l.end(),</span>
<span id="L5789"><span class="lineNum">    5789</span>              :           __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5790"><span class="lineNum">    5790</span>              :     }</span>
<span id="L5791"><span class="lineNum">    5791</span>              : </span>
<span id="L5792"><span class="lineNum">    5792</span>              :   template&lt;typename _Tp&gt;</span>
<span id="L5793"><span class="lineNum">    5793</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5794"><span class="lineNum">    5794</span>              :     inline _Tp</span>
<span id="L5795"><span class="lineNum">    5795</span>              :     max(initializer_list&lt;_Tp&gt; __l)</span>
<span id="L5796"><span class="lineNum">    5796</span>              :     {</span>
<span id="L5797"><span class="lineNum">    5797</span>              :       __glibcxx_requires_irreflexive(__l.begin(), __l.end());</span>
<span id="L5798"><span class="lineNum">    5798</span>              :       return *_GLIBCXX_STD_A::__max_element(__l.begin(), __l.end(),</span>
<span id="L5799"><span class="lineNum">    5799</span>              :           __gnu_cxx::__ops::__iter_less_iter());</span>
<span id="L5800"><span class="lineNum">    5800</span>              :     }</span>
<span id="L5801"><span class="lineNum">    5801</span>              : </span>
<span id="L5802"><span class="lineNum">    5802</span>              :   template&lt;typename _Tp, typename _Compare&gt;</span>
<span id="L5803"><span class="lineNum">    5803</span>              :     _GLIBCXX14_CONSTEXPR</span>
<span id="L5804"><span class="lineNum">    5804</span>              :     inline _Tp</span>
<span id="L5805"><span class="lineNum">    5805</span>              :     max(initializer_list&lt;_Tp&gt; __l, _Compare __comp)</span>
<span id="L5806"><span class="lineNum">    5806</span>              :     {</span>
<span id="L5807"><span class="lineNum">    5807</span>              :       __glibcxx_requires_irreflexive_pred(__l.begin(), __l.end(), __comp);</span>
<span id="L5808"><span class="lineNum">    5808</span>              :       return *_GLIBCXX_STD_A::__max_element(__l.begin(), __l.end(),</span>
<span id="L5809"><span class="lineNum">    5809</span>              :           __gnu_cxx::__ops::__iter_comp_iter(__comp));</span>
<span id="L5810"><span class="lineNum">    5810</span>              :     }</span>
<span id="L5811"><span class="lineNum">    5811</span>              : #endif // C++11</span>
<span id="L5812"><span class="lineNum">    5812</span>              : </span>
<span id="L5813"><span class="lineNum">    5813</span>              : #if __cplusplus &gt;= 201402L</span>
<span id="L5814"><span class="lineNum">    5814</span>              :   /// Reservoir sampling algorithm.</span>
<span id="L5815"><span class="lineNum">    5815</span>              :   template&lt;typename _InputIterator, typename _RandomAccessIterator,</span>
<span id="L5816"><span class="lineNum">    5816</span>              :            typename _Size, typename _UniformRandomBitGenerator&gt;</span>
<span id="L5817"><span class="lineNum">    5817</span>              :     _RandomAccessIterator</span>
<span id="L5818"><span class="lineNum">    5818</span>              :     __sample(_InputIterator __first, _InputIterator __last, input_iterator_tag,</span>
<span id="L5819"><span class="lineNum">    5819</span>              :              _RandomAccessIterator __out, random_access_iterator_tag,</span>
<span id="L5820"><span class="lineNum">    5820</span>              :              _Size __n, _UniformRandomBitGenerator&amp;&amp; __g)</span>
<span id="L5821"><span class="lineNum">    5821</span>              :     {</span>
<span id="L5822"><span class="lineNum">    5822</span>              :       using __distrib_type = uniform_int_distribution&lt;_Size&gt;;</span>
<span id="L5823"><span class="lineNum">    5823</span>              :       using __param_type = typename __distrib_type::param_type;</span>
<span id="L5824"><span class="lineNum">    5824</span>              :       __distrib_type __d{};</span>
<span id="L5825"><span class="lineNum">    5825</span>              :       _Size __sample_sz = 0;</span>
<span id="L5826"><span class="lineNum">    5826</span>              :       while (__first != __last &amp;&amp; __sample_sz != __n)</span>
<span id="L5827"><span class="lineNum">    5827</span>              :         {</span>
<span id="L5828"><span class="lineNum">    5828</span>              :           __out[__sample_sz++] = *__first;</span>
<span id="L5829"><span class="lineNum">    5829</span>              :           ++__first;</span>
<span id="L5830"><span class="lineNum">    5830</span>              :         }</span>
<span id="L5831"><span class="lineNum">    5831</span>              :       for (auto __pop_sz = __sample_sz; __first != __last;</span>
<span id="L5832"><span class="lineNum">    5832</span>              :           ++__first, (void) ++__pop_sz)</span>
<span id="L5833"><span class="lineNum">    5833</span>              :         {</span>
<span id="L5834"><span class="lineNum">    5834</span>              :           const auto __k = __d(__g, __param_type{0, __pop_sz});</span>
<span id="L5835"><span class="lineNum">    5835</span>              :           if (__k &lt; __n)</span>
<span id="L5836"><span class="lineNum">    5836</span>              :             __out[__k] = *__first;</span>
<span id="L5837"><span class="lineNum">    5837</span>              :         }</span>
<span id="L5838"><span class="lineNum">    5838</span>              :       return __out + __sample_sz;</span>
<span id="L5839"><span class="lineNum">    5839</span>              :     }</span>
<span id="L5840"><span class="lineNum">    5840</span>              : </span>
<span id="L5841"><span class="lineNum">    5841</span>              :   /// Selection sampling algorithm.</span>
<span id="L5842"><span class="lineNum">    5842</span>              :   template&lt;typename _ForwardIterator, typename _OutputIterator, typename _Cat,</span>
<span id="L5843"><span class="lineNum">    5843</span>              :            typename _Size, typename _UniformRandomBitGenerator&gt;</span>
<span id="L5844"><span class="lineNum">    5844</span>              :     _OutputIterator</span>
<span id="L5845"><span class="lineNum">    5845</span>              :     __sample(_ForwardIterator __first, _ForwardIterator __last,</span>
<span id="L5846"><span class="lineNum">    5846</span>              :              forward_iterator_tag,</span>
<span id="L5847"><span class="lineNum">    5847</span>              :              _OutputIterator __out, _Cat,</span>
<span id="L5848"><span class="lineNum">    5848</span>              :              _Size __n, _UniformRandomBitGenerator&amp;&amp; __g)</span>
<span id="L5849"><span class="lineNum">    5849</span>              :     {</span>
<span id="L5850"><span class="lineNum">    5850</span>              :       using __distrib_type = uniform_int_distribution&lt;_Size&gt;;</span>
<span id="L5851"><span class="lineNum">    5851</span>              :       using __param_type = typename __distrib_type::param_type;</span>
<span id="L5852"><span class="lineNum">    5852</span>              :       using _USize = make_unsigned_t&lt;_Size&gt;;</span>
<span id="L5853"><span class="lineNum">    5853</span>              :       using _Gen = remove_reference_t&lt;_UniformRandomBitGenerator&gt;;</span>
<span id="L5854"><span class="lineNum">    5854</span>              :       using __uc_type = common_type_t&lt;typename _Gen::result_type, _USize&gt;;</span>
<span id="L5855"><span class="lineNum">    5855</span>              : </span>
<span id="L5856"><span class="lineNum">    5856</span>              :       if (__first == __last)</span>
<span id="L5857"><span class="lineNum">    5857</span>              :         return __out;</span>
<span id="L5858"><span class="lineNum">    5858</span>              : </span>
<span id="L5859"><span class="lineNum">    5859</span>              :       __distrib_type __d{};</span>
<span id="L5860"><span class="lineNum">    5860</span>              :       _Size __unsampled_sz = std::distance(__first, __last);</span>
<span id="L5861"><span class="lineNum">    5861</span>              :       __n = std::min(__n, __unsampled_sz);</span>
<span id="L5862"><span class="lineNum">    5862</span>              : </span>
<span id="L5863"><span class="lineNum">    5863</span>              :       // If possible, we use __gen_two_uniform_ints to efficiently produce</span>
<span id="L5864"><span class="lineNum">    5864</span>              :       // two random numbers using a single distribution invocation:</span>
<span id="L5865"><span class="lineNum">    5865</span>              : </span>
<span id="L5866"><span class="lineNum">    5866</span>              :       const __uc_type __urngrange = __g.max() - __g.min();</span>
<span id="L5867"><span class="lineNum">    5867</span>              :       if (__urngrange / __uc_type(__unsampled_sz) &gt;= __uc_type(__unsampled_sz))</span>
<span id="L5868"><span class="lineNum">    5868</span>              :         // I.e. (__urngrange &gt;= __unsampled_sz * __unsampled_sz) but without</span>
<span id="L5869"><span class="lineNum">    5869</span>              :         // wrapping issues.</span>
<span id="L5870"><span class="lineNum">    5870</span>              :         {</span>
<span id="L5871"><span class="lineNum">    5871</span>              :           while (__n != 0 &amp;&amp; __unsampled_sz &gt;= 2)</span>
<span id="L5872"><span class="lineNum">    5872</span>              :             {</span>
<span id="L5873"><span class="lineNum">    5873</span>              :               const pair&lt;_Size, _Size&gt; __p =</span>
<span id="L5874"><span class="lineNum">    5874</span>              :                 __gen_two_uniform_ints(__unsampled_sz, __unsampled_sz - 1, __g);</span>
<span id="L5875"><span class="lineNum">    5875</span>              : </span>
<span id="L5876"><span class="lineNum">    5876</span>              :               --__unsampled_sz;</span>
<span id="L5877"><span class="lineNum">    5877</span>              :               if (__p.first &lt; __n)</span>
<span id="L5878"><span class="lineNum">    5878</span>              :                 {</span>
<span id="L5879"><span class="lineNum">    5879</span>              :                   *__out++ = *__first;</span>
<span id="L5880"><span class="lineNum">    5880</span>              :                   --__n;</span>
<span id="L5881"><span class="lineNum">    5881</span>              :                 }</span>
<span id="L5882"><span class="lineNum">    5882</span>              : </span>
<span id="L5883"><span class="lineNum">    5883</span>              :               ++__first;</span>
<span id="L5884"><span class="lineNum">    5884</span>              : </span>
<span id="L5885"><span class="lineNum">    5885</span>              :               if (__n == 0) break;</span>
<span id="L5886"><span class="lineNum">    5886</span>              : </span>
<span id="L5887"><span class="lineNum">    5887</span>              :               --__unsampled_sz;</span>
<span id="L5888"><span class="lineNum">    5888</span>              :               if (__p.second &lt; __n)</span>
<span id="L5889"><span class="lineNum">    5889</span>              :                 {</span>
<span id="L5890"><span class="lineNum">    5890</span>              :                   *__out++ = *__first;</span>
<span id="L5891"><span class="lineNum">    5891</span>              :                   --__n;</span>
<span id="L5892"><span class="lineNum">    5892</span>              :                 }</span>
<span id="L5893"><span class="lineNum">    5893</span>              : </span>
<span id="L5894"><span class="lineNum">    5894</span>              :               ++__first;</span>
<span id="L5895"><span class="lineNum">    5895</span>              :             }</span>
<span id="L5896"><span class="lineNum">    5896</span>              :         }</span>
<span id="L5897"><span class="lineNum">    5897</span>              : </span>
<span id="L5898"><span class="lineNum">    5898</span>              :       // The loop above is otherwise equivalent to this one-at-a-time version:</span>
<span id="L5899"><span class="lineNum">    5899</span>              : </span>
<span id="L5900"><span class="lineNum">    5900</span>              :       for (; __n != 0; ++__first)</span>
<span id="L5901"><span class="lineNum">    5901</span>              :         if (__d(__g, __param_type{0, --__unsampled_sz}) &lt; __n)</span>
<span id="L5902"><span class="lineNum">    5902</span>              :           {</span>
<span id="L5903"><span class="lineNum">    5903</span>              :             *__out++ = *__first;</span>
<span id="L5904"><span class="lineNum">    5904</span>              :             --__n;</span>
<span id="L5905"><span class="lineNum">    5905</span>              :           }</span>
<span id="L5906"><span class="lineNum">    5906</span>              :       return __out;</span>
<span id="L5907"><span class="lineNum">    5907</span>              :     }</span>
<span id="L5908"><span class="lineNum">    5908</span>              : </span>
<span id="L5909"><span class="lineNum">    5909</span>              : #if __cplusplus &gt; 201402L</span>
<span id="L5910"><span class="lineNum">    5910</span>              : #define __cpp_lib_sample 201603L</span>
<span id="L5911"><span class="lineNum">    5911</span>              :   /// Take a random sample from a population.</span>
<span id="L5912"><span class="lineNum">    5912</span>              :   template&lt;typename _PopulationIterator, typename _SampleIterator,</span>
<span id="L5913"><span class="lineNum">    5913</span>              :            typename _Distance, typename _UniformRandomBitGenerator&gt;</span>
<span id="L5914"><span class="lineNum">    5914</span>              :     _SampleIterator</span>
<span id="L5915"><span class="lineNum">    5915</span>              :     sample(_PopulationIterator __first, _PopulationIterator __last,</span>
<span id="L5916"><span class="lineNum">    5916</span>              :            _SampleIterator __out, _Distance __n,</span>
<span id="L5917"><span class="lineNum">    5917</span>              :            _UniformRandomBitGenerator&amp;&amp; __g)</span>
<span id="L5918"><span class="lineNum">    5918</span>              :     {</span>
<span id="L5919"><span class="lineNum">    5919</span>              :       using __pop_cat = typename</span>
<span id="L5920"><span class="lineNum">    5920</span>              :         std::iterator_traits&lt;_PopulationIterator&gt;::iterator_category;</span>
<span id="L5921"><span class="lineNum">    5921</span>              :       using __samp_cat = typename</span>
<span id="L5922"><span class="lineNum">    5922</span>              :         std::iterator_traits&lt;_SampleIterator&gt;::iterator_category;</span>
<span id="L5923"><span class="lineNum">    5923</span>              : </span>
<span id="L5924"><span class="lineNum">    5924</span>              :       static_assert(</span>
<span id="L5925"><span class="lineNum">    5925</span>              :           __or_&lt;is_convertible&lt;__pop_cat, forward_iterator_tag&gt;,</span>
<span id="L5926"><span class="lineNum">    5926</span>              :                 is_convertible&lt;__samp_cat, random_access_iterator_tag&gt;&gt;::value,</span>
<span id="L5927"><span class="lineNum">    5927</span>              :           &quot;output range must use a RandomAccessIterator when input range&quot;</span>
<span id="L5928"><span class="lineNum">    5928</span>              :           &quot; does not meet the ForwardIterator requirements&quot;);</span>
<span id="L5929"><span class="lineNum">    5929</span>              : </span>
<span id="L5930"><span class="lineNum">    5930</span>              :       static_assert(is_integral&lt;_Distance&gt;::value,</span>
<span id="L5931"><span class="lineNum">    5931</span>              :                     &quot;sample size must be an integer type&quot;);</span>
<span id="L5932"><span class="lineNum">    5932</span>              : </span>
<span id="L5933"><span class="lineNum">    5933</span>              :       typename iterator_traits&lt;_PopulationIterator&gt;::difference_type __d = __n;</span>
<span id="L5934"><span class="lineNum">    5934</span>              :       return _GLIBCXX_STD_A::</span>
<span id="L5935"><span class="lineNum">    5935</span>              :         __sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d,</span>
<span id="L5936"><span class="lineNum">    5936</span>              :                  std::forward&lt;_UniformRandomBitGenerator&gt;(__g));</span>
<span id="L5937"><span class="lineNum">    5937</span>              :     }</span>
<span id="L5938"><span class="lineNum">    5938</span>              : #endif // C++17</span>
<span id="L5939"><span class="lineNum">    5939</span>              : #endif // C++14</span>
<span id="L5940"><span class="lineNum">    5940</span>              : </span>
<span id="L5941"><span class="lineNum">    5941</span>              : _GLIBCXX_END_NAMESPACE_ALGO</span>
<span id="L5942"><span class="lineNum">    5942</span>              : _GLIBCXX_END_NAMESPACE_VERSION</span>
<span id="L5943"><span class="lineNum">    5943</span>              : } // namespace std</span>
<span id="L5944"><span class="lineNum">    5944</span>              : </span>
<span id="L5945"><span class="lineNum">    5945</span>              : #endif /* _STL_ALGO_H */</span>
        </pre>
              </td>
            </tr>
          </table>
          <br>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
            <tr><td class="versionInfo">Generated by: <a href="https://github.com//linux-test-project/lcov" target="_parent">LCOV version 2.0-1</a></td></tr>
          </table>
          <br>

</body>
</html>
